Nov 21, 2005 #1 T Thommer Junior Member level 1 Joined Apr 12, 2005 Messages 18 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,437 Hello All! I have a probably primitive problem, but please help me! I have a matrix (arbitrary), I want each row of this matrix to be in a separate vector. eg: y=[ -1 1 -1 -1 1 -1 1 -1 -1 1 1 -1]; I tried the following: t = reshape(y',1,[]) -> [-1 1 -1 -1 1 -1 1 -1 -1 1 1 -1] then I'm looking for a command that splits this vector into 3 four-long subvectors.. Or is the any other idea how to solve the main problem? Thank you, Thommer
Hello All! I have a probably primitive problem, but please help me! I have a matrix (arbitrary), I want each row of this matrix to be in a separate vector. eg: y=[ -1 1 -1 -1 1 -1 1 -1 -1 1 1 -1]; I tried the following: t = reshape(y',1,[]) -> [-1 1 -1 -1 1 -1 1 -1 -1 1 1 -1] then I'm looking for a command that splits this vector into 3 four-long subvectors.. Or is the any other idea how to solve the main problem? Thank you, Thommer
Nov 21, 2005 #2 Z zorro Advanced Member level 4 Joined Sep 6, 2001 Messages 1,130 Helped 357 Reputation 712 Reaction score 298 Trophy points 1,363 Location Argentina Activity points 8,913 Hi Thommer, One way is like this row1 = y(1,; % first row row2 = y(2,; % second row ... etc... Regards Z
Hi Thommer, One way is like this row1 = y(1,; % first row row2 = y(2,; % second row ... etc... Regards Z
Nov 23, 2005 #3 D desaipa Member level 2 Joined Jan 20, 2005 Messages 53 Helped 1 Reputation 2 Reaction score 0 Trophy points 1,286 Location india Activity points 487 hi you can reffer to the help bit addressing single row i n matlab 7 help i think it 'll help u for ur problem bye PD
hi you can reffer to the help bit addressing single row i n matlab 7 help i think it 'll help u for ur problem bye PD