Find the maximum two numbers of every column of a matrix - MATLAB Cody - MATLAB Central

Problem 1923. Find the maximum two numbers of every column of a matrix

Difficulty:Rate

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

53.35% Correct | 46.65% Incorrect
Last Solution submitted on Feb 19, 2025

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers198

Problem Tags

max

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Go to top of page