Reading txt files and getting maximum values with characters and numbers
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
BENJAMIN BUCHDA
am 23 Feb. 2021
Kommentiert: BENJAMIN BUCHDA
am 23 Feb. 2021
I am trying to write a function that takes a txt file with names of individuals and their age and income, and with that information find the richest young person and richest old person within the file. I have have approached the problem at difference directions, reading each individual line, making it into a table but I am struggling on even approaching this. Can tips or advice from someone much better at Matlab than me? any help would be appreciated.
2 Kommentare
Walter Roberson
am 23 Feb. 2021
readtable() should read the data easily, but I don't know what "richest young person" means.
Akzeptierte Antwort
Walter Roberson
am 23 Feb. 2021
Example:
T = table(randi(4,20,1), randi(99,20,1))
min1 = min(T{:,1});
T(T{:,1}==min1,:)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Environment and Settings finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!