divide the entries in the column by entries from another column
조회 수: 22 (최근 30일)
이전 댓글 표시
Hi,
I have five arrays lets say A, B , C , D, E of size 100x 3.
Here, For instance, I have to divide entries in the second column of A by sum of entries in the second column of A, B , C , D , E
Something like this
AA = A (:,2)/ ( A(:,2) + B(:,2) + C(:,2) + D(:,2) + E(:,2))
댓글 수: 0
채택된 답변
Voss
2022년 4월 8일
Use element-wise division ( ./ ) and you'll have it:
AA = A(:,2) ./ ( A(:,2) + B(:,2) + C(:,2) + D(:,2) + E(:,2) )
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!