I tried to plot the equation (x-1)/(y+2)^1.8
in octave using surf()
method. But the graph is something else.
Here's my code:
p = linspace(1,50, 100);
t = linspace(1,48,100);
ans = zeros(length(p), length(t));
ans = compute_z(p, t, ans);
figure;
surf(p, t, ans');
trying to compute z = (x-1)/(y+2)^1.8
using helper function compute_z
function [ans] = compute_z(ans, p, t)
for i = 1:length(p)
for j = 1:length(t)
ans(i,j) = (p(i) - 1) / (t(j)+2)^1.8;
end
end
I was trying to generate this graph.