How to separate matrix row?

15 次查看(过去 30 天)
let's say
A = [ 1 2; 1 2; 1 2]
A =
1 2
1 2
1 2
Any command that can I separate it into turn into
B =
1 2
1 2
1 2
C =
0 2
0 2
0 2
Thanks!!
-------------- I try to do it like this, but doesn't work
B = A(:,1)
B =
1
1
1
  1 个评论
Wayne King
Wayne King 2012-5-30
you dramatically changed what you wanted from this post in just a few minutes, so I'm not sure exactly what result you want now.

请先登录,再进行评论。

采纳的回答

Thomas
Thomas 2012-5-30
use
A =[1 2
1 2
1 2]
A(:,1)=0;
B=A
  1 个评论
chewkaisheng
chewkaisheng 2012-5-30
Thank you!!
It's really work!
Actually my matrix is about the sound signal..
although it become zeros , but still have a little of signal listening...

请先登录,再进行评论。

更多回答(1 个)

Wayne King
Wayne King 2012-5-30
A = [ 1 2; 1 2; 1 2];
A(:,1) = zeros(size(A,1),1);
Or if you want to keep your original A
B = zeros(size(A));
B(:,2) = A(:,2);

类别

Help CenterFile Exchange 中查找有关 Data Type Conversion 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by