Matrix operations with continuous variable
16 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
mattzoe
am 9 Jun. 2019
Beantwortet: Walter Roberson
am 9 Jun. 2019
Hello everybody,
I want to multiply two matrices, which contains a continuous variable q and some constants.
To solve this problem, I must use the numerically way.
When I fill the matrix, I get this problem "Dimensions of arrays being concatenated are not consistent.". I think this comes from the constants in the matrices.
Another problem is how can I mutiply the matrices stepwise for each value of q?
Is there an easy way to do this?
q = 4:2:10; % q is a continuous variable
B = [q, cos(q) ;
5, 3*q ;
2*q, 8]
C = [q, sin(q) ;
2, 3*q ;
q, cos(q)]
A = B .* C
Best regards!
1 Kommentar
madhan ravi
am 9 Jun. 2019
https://in.mathworks.com/matlabcentral/answers/466136-storing-matrices-from-a-for-loop - how is that different from this??
Akzeptierte Antwort
Walter Roberson
am 9 Jun. 2019
B = [q, cos(q) ;
5*ones(size(q)), 3*q ;
2*q, 8*ones(size(q))]
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!