Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: saving the variables in for loop
Replies: 1   Last Post: Dec 9, 2012 8:48 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 382
Registered: 1/12/09
Re: saving the variables in for loop
Posted: Dec 9, 2012 8:48 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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);'])


"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"

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2015. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.