I'm new to matlab and would like to create a new vector equal to a row of an nxn matrix that I already have. I know how to do it with loops but is there a command? Something like
vector1=matrix1(row5)
Thanks!
I'm new to matlab and would like to create a new vector equal to a row of an nxn matrix that I already have. I know how to do it with loops but is there a command? Something like
vector1=matrix1(row5)
Thanks!
Yep this is easy, the syntax is:
row5Vector = matrix1(5,:);
Also to grab a column you could:
col5Vector = matrix1(:,5);