How do i increase the number value in " "

조회 수: 1 (최근 30일)
LinusL
LinusL 2021년 8월 9일
댓글: Rik 2021년 8월 9일
I have
a file to read multiple folder by looking at the number
%Image number set
number = "1"
[first,second,third,fourth,five]= returnFiles(number);
%The function
function [first,second,third,fourth,five] = returnFiles(number)
.....
How do I keep looping and increase the number to read multiple file

채택된 답변

Walter Roberson
Walter Roberson 2021년 8월 9일
for K = 1 : 50
number = string(K);
[first,second,third,fourth,five] = returnFiles(number);
end
  댓글 수: 2
LinusL
LinusL 2021년 8월 9일
what does K = 1 : 50 do?
It count toward 50?
Rik
Rik 2021년 8월 9일
It creates a vector from 1 to 50. Combining it with the for keyword means it will execute the contents of the loop with each value of that vector stored in K.
Any Matlab tutorial will have taught you this. I would highly encourage you to do one.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by