how to write increment operator in matlab to read files one after antother..help
조회 수: 1 (최근 30일)
이전 댓글 표시
how to write this type of function in matlab
for(i=0;i<20;i++)
댓글 수: 1
답변 (1개)
dpb
2016년 11월 16일
편집: dpb
2016년 11월 16일
Just translate...
for i=0:19
...
i will take on the values in succession automagically and can be used in the loop.
NB: Matlab arrays, however, are 1-based, not 0-based, so the above will fail if try to write
for i=0:19
value=someoperationon(a(i));
with indexing error "Subscript indices must either be real positive integers or logicals."
If, however, the idea is to read a series of files with successive numeric values in the file names somehow using this to generate names, that's not recommended practice in Matlab for variables and the like altho can be done for file names. But, generally are easier ways, dir with a suitable wildcard pattern being one of the best. See the FAQ <Process sequence of files>
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!