On 3/15/2013 8:06 PM, Isaac wrote:
> I want to open several .dat files and I used the next command with
> uigetfile
>
> filename = uigetfile({'*.*';'*.dat';'*.txt'}, 'Seleccionar archivos',
> 'MultiSelect', 'on');
>
> The problem is that I can´t read the information of this files. I tried
> using -load-, but matlab said me that need an string arguments. I also
> tried to convert the cell array to number array, but matlab give only
> the names of my archives.
for f={filename}
d=load(f);
...
Sorry, filename will be a string array so don't want the {} to
expand--just use
for f=filename
d=load(f);
BTW, if you can write a pertinent wildcard expression, then
d=dir('*.dat'); % say--all .dat files
for f={d.name} % here's where need the curlies...
x=load(f);
...
--
> I want to open several .dat files and I used the next command with
> uigetfile
>
> filename = uigetfile({'*.*';'*.dat';'*.txt'}, 'Seleccionar archivos',
> 'MultiSelect', 'on');
>
> The problem is that I can´t read the information of this files. I tried
> using -load-, but matlab said me that need an string arguments. I also
> tried to convert the cell array to number array, but matlab give only
> the names of my archives.
for f={filename}
d=load(f);
...
Sorry, filename will be a string array so don't want the {} to
expand--just use
for f=filename
d=load(f);
BTW, if you can write a pertinent wildcard expression, then
d=dir('*.dat'); % say--all .dat files
for f={d.name} % here's where need the curlies...
x=load(f);
...
--