how do i multiply n number of matrix for 2x2 with the symboic output
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens


hi how do i use my symbolc output results and do a matrix multiplication for a 2x2 matrix?thank you in advance
5 commentaires
Walter Roberson
le 20 Fév 2022
M is the 2x2 matrix that you want to multiply by.
Maybe you want
E = ABCD
for n=1:9
E = E*ABCD;
end
Réponses (2)
grace lim
le 20 Fév 2022
1 commentaire
Walter Roberson
le 20 Fév 2022
I am not going to type in your equations from your image, so I will illustrate with some examples:
syms h0 h1 h2 h3
A = 1/(h0+h1)
B = h0/(h0+h2)
C = h2*h3/h0
D = h3 - h1
ABCD = [A B; C D]
E = ABCD
for n = 1:9
E = E*ABCD;
end
E
If you need to see the results of each multiplication in turn, then change E = E*ABCD; to become E = E*ABCD without the semi-colon
grace lim
le 21 Fév 2022
3 commentaires
Walter Roberson
le 21 Fév 2022
How does ABCD differ from the [A B;C D] you assign to E, and how does that differ from the [A B;C D] that you assign to F?
Or are you changing A B C D between those points?
Anyhow... go ahead with your code. Just make sure you get right how many multiplications you want to do.
If we call the new A B C D as nA, nB, nC, nD then do you want [nA, nB; nC, nD] * ABCD^9 or do you want [nA, nB; nC, nD] * ABCD^10 ? Your current code would give [nA, nB; nC, nD] * ABCD^9 . In the special case where nA, nB, nC, nD are the same as A, B, C, D, then nA, nB; nC, nD] * ABCD^9 would be the same as ABCD^10
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



