How to find min and max of a text file full of numbers?
13 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
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
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Text Files 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!