[~, idx] = max(YourMatrix(:,2)); THE_TIME = YourMatrix(idx,1);
finding maximum value of a column
12 views (last 30 days)
Show older comments
Tony Garcia
on 19 Apr 2018
Commented: Walter Roberson
on 20 Apr 2018
so i have this matrix 193X2 where column 1 is the time and column 2 is cars counted i want to find THE TIME where the maximum car is counted can someone help me?
0 Comments
Accepted Answer
Walter Roberson
on 19 Apr 2018
2 Comments
Walter Roberson
on 20 Apr 2018
That is the same as
[SomeVariableNotOtherwiseUsed, idx] = max(YourMatrix(:, 2)) clear SomeOtherwiseUnusedVariableName
More Answers (0)
See Also
Categories
Find more on String Parsing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!