MATLAB Answers

How to combine multiple columns into array?

5 views (last 30 days)
pink flower
pink flower on 2 Sep 2020
Edited: per isakson on 2 Sep 2020
I have 5 columns and I would like to join them and form a matrix with n rows and 5 columns. How can I do this?

  0 Comments

Sign in to comment.

Accepted Answer

per isakson
per isakson on 2 Sep 2020
Edited: per isakson on 2 Sep 2020
Two ways
array = cat( 2, col1, col2, col3, col4, col5 );
array = [ col1, col2, col3, col4, col5 ];

  0 Comments

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by