Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

Re: Problem with open several .dat files

$
0
0
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);
   ...


--

Viewing all articles
Browse latest Browse all 19628

Trending Articles