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

3 ビュー (過去 30 日間)
NikePro
NikePro 2016 年 2 月 5 日
コメント済み: Star 2019 年 1 月 6 日
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 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2016 年 2 月 5 日
can you give more details, or explain with an example?
NikePro
NikePro 2016 年 2 月 5 日
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.

サインインしてコメントする。

採用された回答

Star Strider
Star Strider 2016 年 2 月 5 日
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 件のコメント
Star
Star 2019 年 1 月 6 日
How to find the x intercept of FileMax and FileMin?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by