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: problem with load
Replies: 2   Last Post: Jul 31, 1996 6:21 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
bala@slip.net

Posts: 3
Registered: 12/7/04
Re: problem with load
Posted: Jul 30, 1996 11:46 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi!

When you create a filename as a string, you can get Matlab to execute
it as a command using the "eval" function.

For example, if blahblah is your string, try

eval(blahblah)

that should do it.

bala.



Bhaskar Thiagarajan <bhaskart@engin.umich.edu> wrote:

>Hi,

>I want to load a series of data files, every time I run my m-file.
>The data files can be A0.dat, A1.dat...,A4.dat,...H4.dat


>I have included my code for my m-file below.

>The load statement doesn't seem to work with string variables :-(

>Any way I can get around the problem??

>% To load all data files in Matlab

>chan='a';
>clust=0;


>while (chan<='h'),
> while(clust<=4),
> %text = [int2str(chan)];
> text=chan;
> num = [int2str(clust)];
> file=['c:\bwlib\src\ufftest\' text num '.dat']
> if (exist(file)==2) %check to see if file exists
> load file;
> end;
> clust=clust+1;
> end;
> chan=chan+1
>end;


>Thanks

>-Bhaskar






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

[Privacy Policy] [Terms of Use]

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