Iteration for files structures

1 Ansicht (letzte 30 Tage)
George
George am 8 Mär. 2015
Beantwortet: Image Analyst am 8 Mär. 2015
Hello
I am trying to iteratively process several files that have the same name but different year indices. The files are comprised of structures and I would like to extract specific information to attempt the creation of other files. The notion is to combine iteratively e.g. Str_2004.X;Str_2005.X etc or even add them as Str_2004.X+Str_2005.X
I have tried to call them as
fname = who('Str_*')
count=length(fname)
for i=1:count
S.new = fname(i).X; fname(i+1).X
end
but I get an improper dimensions warning
Any help you be welcome
thank you
  1 Kommentar
Jan
Jan am 8 Mär. 2015
Please post a complete copy of the error message. I do not understand the purpose of the shown code.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Image Analyst
Image Analyst am 8 Mär. 2015
You want dir() instead of whos(). Anyway, see the FAQ for the proper, more robust way of coding this:

Kategorien

Mehr zu File Operations finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by