I need to evaluate the greyscale of several images, I use the command "improfile" to do this. Since there are several images that need to be evaluated I decided to use a for loop. However I'm having some problem with the name recognition of my images. The code I've written is:
cd test
A=dir('*.bmp');
x = [300,1000];
y = [512,512] ;
G = length(A);
for n=1:G
eval(['M' num2str(n) '=imread(A(n).name);']);
end
for i=1:G
improfile(M num2str(G),x,y),grid on;
end
for some reason I do not understand it fails to accept the num2str(G) syntax in second for loop. If someone can help me out that would be great
cd test
A=dir('*.bmp');
x = [300,1000];
y = [512,512] ;
G = length(A);
for n=1:G
eval(['M' num2str(n) '=imread(A(n).name);']);
end
for i=1:G
improfile(M num2str(G),x,y),grid on;
end
for some reason I do not understand it fails to accept the num2str(G) syntax in second for loop. If someone can help me out that would be great