Consider a matrix A such as

A = [1 2 3 3 4 5 6;
     2 3 4 5 6 7 8];

Can you convert this matrix to a three-column matrix like this:

M=[1 2 3;
   2 3 3;
   3 3 4;
   3 4 5;
   4 5 6;
   2 3 4;
   3 4 5;
   4 5 6;
   5 6 7;
   6 7 8]

hint: please look at Problem 43964

Solution Stats

162 Solutions

55 Solvers

Last Solution submitted on Apr 01, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers55

Suggested Problems

More from this Author21

Community Treasure Hunt

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

Start Hunting!