How to extract columns of a matrix into seperate vectors?
Hallo,
Let’s assume a matrix (100×3). I want to extract out each of the columns, and store them in 3 separate vectors.
The code for the loop is clear, but what’s the right code for storing each column?
—————————-
for i = 1 : 3
vector = matrix(:, i);
end
—————————-
I guess it’s probably simple, but I am still a beginner and couldn’t find much useful information in the documentation so far.
Thank you.
DominikHallo,
Let’s assume a matrix (100×3). I want to extract out each of the columns, and store them in 3 separate vectors.
The code for the loop is clear, but what’s the right code for storing each column?
—————————-
for i = 1 : 3
vector = matrix(:, i);
end
—————————-
I guess it’s probably simple, but I am still a beginner and couldn’t find much useful information in the documentation so far.
Thank you.
Dominik Hallo,
Let’s assume a matrix (100×3). I want to extract out each of the columns, and store them in 3 separate vectors.
The code for the loop is clear, but what’s the right code for storing each column?
—————————-
for i = 1 : 3
vector = matrix(:, i);
end
—————————-
I guess it’s probably simple, but I am still a beginner and couldn’t find much useful information in the documentation so far.
Thank you.
Dominik matrix, column, separate, bad idea MATLAB Answers — New Questions