How to find min and max of a text file full of numbers?

5 vues (au cours des 30 derniers jours)
NikePro
NikePro le 5 Fév 2016
Commenté : Star le 6 Jan 2019
I am trying to figure out how to find a specific value in a text file such as being able to find a min and max by MATLAB reading a .txt and finding the max / min values.
  2 commentaires
Azzi Abdelmalek
Azzi Abdelmalek le 5 Fév 2016
can you give more details, or explain with an example?
NikePro
NikePro le 5 Fév 2016
Yes, I am trying to find the highest and lowest number in this text file. I am trying to create a code that will read the file and then spit out the highest and lowest numbers.

Connectez-vous pour commenter.

Réponse acceptée

Star Strider
Star Strider le 5 Fév 2016
This works:
fidi = fopen('Kurtis2821 Text.txt','r');
D = textscan(fidi, '%f%f%f%f%f', 'HeaderLines',1, 'CollectOutput',1);
FileMax = max(D{:}(:))
FileMin = min(D{:}(:))
FileMax =
146.7
FileMin =
-121.08
  1 commentaire
Star
Star le 6 Jan 2019
How to find the x intercept of FileMax and FileMin?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Environment and Settings 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!

Translated by