Iteration for files structures

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

Jan
Jan 2015년 3월 8일
Please post a complete copy of the error message. I do not understand the purpose of the shown code.

댓글을 달려면 로그인하십시오.

답변 (1개)

Image Analyst
Image Analyst 2015년 3월 8일

0 개 추천

You want dir() instead of whos(). Anyway, see the FAQ for the proper, more robust way of coding this:

카테고리

도움말 센터File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

제품

태그

질문:

2015년 3월 8일

답변:

2015년 3월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by