Given a matrix, find the minimal path from the top left to the bottom right by only moving to the right and down so that the summation is minimum.

Use linear index to show the path.

For example,

 x=[ 2     2     2     2     2
    10    10    10     1     2
    20    20    20     1     2
    30    30    30    30     2]

The minimal path is -- [1 5 9 13 14 15 19 20]

Solution Stats

53 Solutions

14 Solvers

Last Solution submitted on Jul 30, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers14

Suggested Problems

More from this Author174

Problem Tags

Community Treasure Hunt

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

Start Hunting!