MATLAB: How to plot a surface in MATLAB

equationsurf

lamda=0.218;
rl=2.2;
N=20
[fi, fn] = meshgrid(linspace(10,180,N),linspace(1,2,N));
gamma=pi./fn;
x=1-cosd(fi);
a=1-cosd(fi);
b=(gamma/rl)*(1-0.5*(1-cosd(fi)));
c=(0.25*lamda*(fi.*pi/180).^2)*(1-cosd(fi));
d=0.5*lamda*(fi.*pi/180).^2;
e=0.5*(fi.*pi/180).^2*lamda;
f=0.5*(fi.*pi/180)*lamda*sind(fi);
g=(0.5*(fi.*pi/180).^2*lamda)*(1-cosd(fi));
h=(0.25*(fi.*pi/180)*lamda*gamma)*(1-cosd(fi));
den=a+b-c+d-e+f-h+g;
Gdc=x./den
surf(fi, fn, Gdc, 'edgecolor', 'b')
I have to plot a surface by these equations but it is not giving me what i expected. Can anyone help me?

Best Answer

You did not give us any ideas what you were expecting so it is difficult to debug.
Possibly in c, g, h, you want .* (1-cosd(fi)) instead of * (1-cosd(fi))
By the way, for efficiency you should calculate (1-cosd(fi)) only once and use the result multiple times.