Adding additional column into the array
조회 수: 81 (최근 30일)
이전 댓글 표시
Hi,
I have two arrays A, B of size 100 x 3 and 100 x 5 . Here I would like to copy the entries in the fifth column of B array to fourth coulmn in A. So finnaly A becomes 100 x 4.
Any idea how to do this..??
댓글 수: 0
채택된 답변
Benjamin Thompson
2022년 4월 8일
Reducing row size from 100 to 5 for clarify of answering here.
>> A = zeros(5,3)
A =
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
>> B = ones(5,5)
B =
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
>> A(:,4) = B(:,5)
A =
0 0 0 1
0 0 0 1
0 0 0 1
0 0 0 1
0 0 0 1
>>
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!