How can I assign a variabe name for 10 jpg files in a for loop?
조회 수: 1 (최근 30일)
이전 댓글 표시
With using a for loop to open ten photos for overlapping, what would be good layout for a for loop to open 10 photos to assign a variable per photo? The jpg files are name accordingly to a numerical order (A001.jpg to A010.jpg).
댓글 수: 0
답변 (1개)
Honglei Chen
2017년 6월 9일
편집: Honglei Chen
2017년 6월 9일
Something like this might work for you
for m = 1:10
filename = sprintf('A%03d.jpg',m);
imread(filename,'jpg');
end
HTH
댓글 수: 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!