getting an entire row containing the max value in column n in a matrix
Show older comments
Hello everyone,
here is my problem :
I have lots of files containing a matrix of the form N x 3 elements ; and I would like to extract the entire row containing the maximum value of the second column so I can write them in a new matrix.
I tried the MAX function but it gives me the maximum value of each row...
Any help ? Thank you !!
1 Comment
Azzi Abdelmalek
on 5 Feb 2014
Matthieu commented
Thank you very much for the fast answer !
I already had written the rest of the code so everythink is working now.
Thanks again !
Accepted Answer
More Answers (1)
Image Analyst
on 5 Feb 2014
0 votes
Azzi gave you code for extracting the row that has the max in the array A. To get the arrays "A" from all your various files, see the FAQ: http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F
Categories
Find more on Creating and Concatenating Matrices 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!