What is the syntax of fscanf? Suppose a.dat contains the float numbers 1 and 2. Write the commands to read the numbers to f1 and f2?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Tucker Russ
le 10 Fév 2014
Commenté : Tucker Russ
le 10 Fév 2014
What is the syntax of fscanf? Suppose a.dat contains the float numbers 1 and 2. Write the commands to read the numbers to f1 and f2?
0 commentaires
Réponse acceptée
Walter Roberson
le 10 Fév 2014
Modifié(e) : Walter Roberson
le 10 Fév 2014
T = fscanf(fid, '%f%f', 2);
f1 = T(1);
f2 = T(2);
or
f1 = fscanf(fid, '%f', 1);
f2 = fscanf(fid, '%f', 1);
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!