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!