Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
Sadik
Posts:
363
Registered:
1/12/09
|
|
Re: saving the variables in for loop
Posted:
Dec 9, 2012 8:48 PM
|
|
Hi Raghda,
Some people in this newsreader have an allergy against the function eval, but you can do this:
for i=1:26 imFilename = sprintf('DB/%d.jpg', i); eval(['[im' num2str(i) ', des' num2str(i) ', loc' num2str(i) '] = sift(imFilename,i);']) end
Best.
"raghda " <zezo.abeer@yahoo.com> wrote in message <ka0htc$m14$1@newscl01ah.mathworks.com>... > plz i have this code > for i=1:26 > imFilename = sprintf('DB/%d.jpg', i); > [im , des , loc ] = sift(imFilename,i); > end > and i need for each iteration , the output is saved likes "im1 des1 loc1 for the first saved file and im2 des2 loc2 for the secon saved file... " by function save ('filename.mat') but i need it for each "i"
|
|
|
|