how to read a txt file as input values?
2 次查看(过去 30 天)
显示 更早的评论
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!
0 个评论
采纳的回答
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 Center 和 File Exchange 中查找有关 Whos 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!