I am a beginner, so I am familiar with matlab. I am trying to plot a function: f(x, y) = x^2 * y, but it looks like something wrong. I am also trying another way but it looks different with a result I got from Google. Is there anybody have experience this problem, help me please?
The method I am trying is: x = rcost, y = rsint -> f(r, t) = r^2 * cos^2(t) * r * sin(t)
ra = linspace(-2.0, 2.0); theta = linspace(-0.5*pi, 0.5*pi); [TH, RA] = meshgrid(theta, ra); F = RA.^3 * cos(TH) * cos(TH) * sin(TH); surf(TH,RA,F); shading interp;
Best Answer