%script to view a parabola (I think it is a parabola, anyway) %JRA, April 12, 2002 %grid size nx = 50; ny = nx; %grid range mine=-10; maxe=10; minn = mine; maxn = maxe; %set up the easting and northing grids estep = abs((mine-maxe)/nx); nstep = abs((minn-maxn)/ny); ee = [mine:estep:maxe]; nn = [minn:nstep:maxn]; e= meshgrid(ee,ee); n= meshgrid(nn,nn)'; %here are the shape parameters. If a=b, then it is symmetric, a not equal b is assymmetric a=1; b=1; c=200; %here is the action. Note that we have to subtract from c because other wise it is a bowl. h=c-(a.*e.^2+b.*n.^2); %color image map figure(1) clf plot(0,0,'k+') hold on imagesc(ee',nn',h) xlabel('easting') ylabel('northing') title('tester') axis equal colorbar %surface figure(2) clf surfl(ee,nn,h) shading interp colormap(copper) hold on view(-30,60) xlabel('easting') ylabel('northing') zlabel('elevation') title('tester')