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
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.
採用された回答
その他の回答 (1 件)
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);
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Data Type Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!