MATLAB Answers

Splitting matrix into arrays

2 views (last 30 days)
how can I split a 2x1000 matrix into a 1x1000?


Sign in to comment.

Accepted Answer

Robin Kirsch
Robin Kirsch on 9 May 2020
I assume that you want to split a 2x1000 matrix into 2 1x1000 vectors.
A simple solution to do this is to extract each row, if A is your 2x1000 then you get the 1x1000 with
B = A(1,:) and C = A(2,:).
You can for-loop over this for x dimensional matrices

  1 Comment

Chase O'Melia
Chase O'Melia on 9 May 2020
Exactly what I was looking for. Thanks!

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!