Quantcast
Channel: MATLAB Central Newsreader - tag:"improfile"
Viewing all articles
Browse latest Browse all 15

Re: Analysing multiple images in a forloop, problem with name recognition.

$
0
0
"Steven Lord" <Steven_Lord@mathworks.com> wrote in message <n6j7fo$erj$1@newscl01ah.mathworks.com>...
>
>
> "Guido de Haan" <guido.dehaan03@gmail.com> wrote in message
> news:n6hfer$es3$1@newscl01ah.mathworks.com...
> > 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);']);
>
> DON'T DO THIS.
>
> See question 1 in the Programming section of the FAQ for an explanation why
> this is a bad idea and alternatives you should use instead.
>
> http://matlab.wikia.com/wiki/FAQ
>
> --
> Steve Lord
> slord@mathworks.com
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com

I agree with Steve although I think he means to refer to Q3.1 which is available from the MATLAB FAQ here:

<<http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F>>

Viewing all articles
Browse latest Browse all 15

Latest Images

Trending Articles





Latest Images