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.
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposta accettata
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!