How do I create a row vector P, that contains the sum of the values in column 2 and the sum of the values in column 5 of matrix B.
조회 수: 1 (최근 30일)
이전 댓글 표시
Given: B=rand(randi([10 20]),randi([5 30]))
Find: Create a row vector P, that contains the sum of the values in column 2 and the sum of the values in column 5 of matrix B.
Issue: I am unfamiliar with the wording, or how to contain the two sums in one variable using code. Variable P must be of size [1 2].
My Solution: I got as far as to state >>P=sum(B(:,2); but I do not know how to get the required parameters.
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!