How to exclude some files while load a set of files using a loop?
    조회 수: 1 (최근 30일)
  
       이전 댓글 표시
    
I am loading a set of files using loop as follows:
 for k=1:10
    A{k} = load(['E:/MatlabData/File',num2str(k),'.asc']);      
 end
As it is clear in the loop, I have a set of 10 files. I want to exclude some files, for example, I don't want to load 5th one and 7th one... How can I exclude those files from the loop? This will be more complicated for me if I have 15 files and have to exclude 3, 4, 5 and 8th file! Any solution?
댓글 수: 0
채택된 답변
추가 답변 (1개)
  Yujia Hu
 2014년 6월 24일
        Are you asking how to loop for a set of numbers? Like this:
k=[1,2,6,7,9:15];
for j = k
    A{k} = j     
end
댓글 수: 0
참고 항목
카테고리
				Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


