Index: ../trunk-jpl/examples/Pig/PigRegion.m =================================================================== --- ../trunk-jpl/examples/Pig/PigRegion.m (revision 20796) +++ ../trunk-jpl/examples/Pig/PigRegion.m (revision 20797) @@ -7,12 +7,12 @@ % Get necessary data to build up the velocity grid xmin = ncreadatt(nsidc_vel,'/','xmin'); ymax = ncreadatt(nsidc_vel,'/','ymax'); -spacing = ncreadatt(nsidc_vel,'/','spacing');ls +spacing = ncreadatt(nsidc_vel,'/','spacing'); -nx = double(ncreadatt(nsidc_vel,'/','nx')); -ny = double(ncreadatt(nsidc_vel,'/','ny')); -vx = double(ncread(nsidc_vel,'vx')); -vy = double(ncread(nsidc_vel,'vy')); +nx = double(ncreadatt(nsidc_vel,'/','nx')); +ny = double(ncreadatt(nsidc_vel,'/','ny')); +vx = double(ncread(nsidc_vel,'vx')); +vy = double(ncread(nsidc_vel,'vy')); xmin = strtrim(xmin); % this is a string, and we need to recover the double value xmin = str2num(xmin(1:end-2)); % get rid of the unit and convert to double @@ -28,14 +28,14 @@ y=(ymax)-(0:1:ny)'*spacing; %Limit the region to Pine Island -posx=find(x<=-12.0e5 & x>=-18.0e5); -x_pig=x(posx); -posy=find(y<=1.0e5 & y>-4.0e5); -y_pig=flipud(y(posy)); +posx = find(x<=-12.0e5 & x>=-18.0e5); +x_pig = x(posx); +posy = find(y<=1.0e5 & y>-4.0e5); +y_pig = flipud(y(posy)); -vx_pig=flipud(vx(posx,posy)'); -vy_pig=flipud(vy(posx,posy)'); -vel_pig=sqrt(vx_pig.^2+vy_pig.^2); +vx_pig = flipud(vx(posx,posy)'); +vy_pig = flipud(vy(posx,posy)'); +vel_pig = sqrt(vx_pig.^2+vy_pig.^2); -imagesc(x_pig,y_pig,log(vel_pig+1)) -axis xy equal +imagesc(x_pig,y_pig,log(vel_pig+1)); +axis xy equal tight;