how to read a txt file as input values?

조회 수: 2 (최근 30일)
sam plant
sam plant 2018년 11월 8일
댓글: sam plant 2018년 11월 9일
I wish to read a txt file with a 4x4 square of input values st matlab reads the first row and enters them into my inputs, then the second row etc... any help would be appreciated!

채택된 답변

Walter Roberson
Walter Roberson 2018년 11월 9일
num = load('YourFile.txt') ;
for K = 1 : size(num, 1)
First = num(K, 1);
Second = num(K, 2);
Third = num(K, 3);
Last = num(K, 4);
Do whatever at this point
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Whos에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by