Problem 1923. Find the maximum two numbers of every column of a matrix
Find the maximum two numbers of every column of a matrix.
Example:
If we input a matrix
A = [ 1 2 4 6 0 3 4 1 5 ]
we should get
B = [ 6 2 5 4 1 4 ]
Solution Stats
Problem Comments
-
1 Comment
goc3
on 15 Mar 2017
Additional test cases have been added.
Solution Comments
Show commentsGroup

Indexing III
- 23 Problems
- 44 Finishers
- expand intervals vol.3
- remove single elements
- return row and column indices given 2 values which define a range
- expand intervals vol.2
- compress sequence into intervals
- expand intervals
- Max Change in Consecutive Elements
- remove single elements
- Back to basics - mean of corner elements of a matrix
- Time Expansion
- Three...is a magic number.
- counting groups!
- Largest territory
- Replace pattern 0 1 0 and 1 0 1
- Find the index of n in magic(n)
- Sum of odd numbers in a matrix
- return row and column indices given 2 values which define a range
- Another colon problem
- How unique?
- Finding neighbors of [-1:1] in a matrix....
- Find the maximum two numbers of every column of a matrix
- Index one element in each vector of an array along a given dimension
- Tridiagonal
- Index of a Rational number
- Sort numbers by outside digits
Problem Recent Solvers198
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!