Apply a formula and create a new matrix
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
matlabuser
il 27 Ago 2020
Commentato: matlabuser
il 28 Ago 2020
Suppose I have 2 matrices :
x = 

and y = 
I am not able to figure out the code that will output a matrix which calculates the following: 
1 Commento
Risposta accettata
Bruno Luong
il 27 Ago 2020
Modificato: Bruno Luong
il 27 Ago 2020
b.'*sum(A,2)
sum(A,2).'*b % preferable than
sum(A.'*b) % or
sum(b.'*A) % or
sum(A.*b,'all')
or
s = 0;
for i=1:size(A,1)
for j=1:size(A,2)
s=s+A(i,j)*b(i);
end
end
s
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Creating and Concatenating Matrices 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!