how to read a txt file as input values?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Walter Roberson
le 9 Nov 2018
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
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Workspace Variables and MAT-Files dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!