Unformatted text preview: %determines if the number is a percentage a = str2num(nw(1:end-1)); %converts the actual numbers of the string into double num = (a./100).*c; %figures out the correct number of columns if the input is a %percent else num = str2num(nw); %if not a percent, then convert to double end else num = nw; %if double, then keep end if ischar(nh) if strcmp(nh(end),'%') b = str2num(nh(1:end-1)); num2 = (b./100).*r; else num2 = str2num(nh); end else num2 = nh; end %lines 34 - 43 do the same operations with the new height (which %corresponds to the rows of the image array rind = round(linspace(1,r,num2)); cind = round(linspace(1,c,num)); %lines 46 - 47 determine the new dimensions of the output reimarr = imarr(rind,cind,:); %indexes into the original array with the new dimensions...
View Full Document
This note was uploaded on 10/21/2010 for the course CS 1371 taught by Professor Stallworth during the Spring '08 term at Georgia Tech.
- Spring '08