function scaledmap (x, y, xblocks, yblocks, interpmethod) %scaledmap % %IMAGESC Scale data and display as image. % IMAGESC(...) is the same as IMAGE(...) except the data is scaled %to use the full colormap. % %EXAMPLE: %imagesc %figure(6) %clf %plot(0,0,'k+') %hold on %imagesc(ee',nn',zi) %show data: %plot(e,n,'k.') %xlabel('easting') %ylabel('northing') %title('Cubic interpolation and observation points') %axis equal %print -depsc vmimage.eps % %Wendy Bohon, March 10, 2009 interpmethod = 'linear' %Make the figure figure(3) clf %this brings up "help" and gives lots of instructions on griddata help griddata %tells griddata what the x and y grid looks like on which %it will operate-it's the easting/northing stepsize. %It needs to be positive, so if it ends up being negative %you need to take the absolute value, which is the "abs" command numsteps=100 estep = abs((min(e)-max(e))/numsteps); nstep = abs((min(n)-max(n))/numsteps); ee = [min(e):estep:max(e)]; nn = [min(n):nstep:max(n)]; %This grids the data. %the 'n means transpose N (switch it from a row vector to a column vector) % This was orginial [xi,yi,zi] = griddata(e,n,hh,ee,nn'); [xi,yi,zi] = griddata(e,n,h,ee,nn'); %Scales the image imagesc(ee',nn',zi) hold on %show data: plot(e,n,'k.') %labels the axes and makes a title, prints as a jpeg xlabel('easting') ylabel('northing') title('Scaled Image') axis equal colorbar print('scalemap_SAF.jpg','-djpeg'); end