Effacer les filtres
Effacer les filtres

Fgetl in a while loop.

7 vues (au cours des 30 derniers jours)
Lucas  Buckels
Lucas Buckels le 3 Avr 2017
In the code in the attached picture, does the first fgetl read the first line (Apple) and str2num(fgetl(file) read the second line (65.1)?
  4 commentaires
Lucas  Buckels
Lucas Buckels le 4 Avr 2017
I was provided the code to study from and yes I did test it, but I was still confused as to why it works. I am trying to see if that is why this code works so I know for the future.
Lucas  Buckels
Lucas Buckels le 4 Avr 2017
I am still shaky using fgetl

Connectez-vous pour commenter.

Réponses (1)

Walter Roberson
Walter Roberson le 4 Avr 2017
"does the first fgetl read the first line (Apple) and str2num(fgetl(file) read the second line"
Yes.
Question for you: what name is going to be reported if the file is empty?

Catégories

En savoir plus sur Search Path dans Help Center et File Exchange

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by