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
  1 件のコメント
sam plant
sam plant 2018 年 11 月 9 日
thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeWorkspace Variables and MAT-Files についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by