Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
|
|
Re: problem with load
Posted:
Jul 30, 1996 11:46 AM
|
|
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
|
|
|
|