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!