Solving Matrices with multiple variables
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen

I am really struggling to work out how to solve this, can anyone help with any suggestions of how to solve this for a beginner?
I have tried to search how to solve but all the videos and tutorials I can find are solving simulatneous equations with only variables in one matrix.
I think I mostly need to know how to input variables within the matrices themselves, this should help me with solving the rest.
0 Kommentare
Antworten (1)
Walter Roberson
am 24 Jun. 2021
Example:
M = randn(6,6)
guesses = randn(1,6);
f = @(x) [x(1),0,1,2,x(2),x(3)].' - M*[0;x(4);x(5);x(6);0;0]
fsolve(f, guesses)
2 Kommentare
Walter Roberson
am 24 Jun. 2021
The general idea is that when you have sets of equations, you can often rewrite them as sets of zero finding.
L1(x) = R1(x)
L2(x) = R2(x)
can be rewritten as
L1(x) - R1(x) = 0
L2(x) - R2(x) = 0
then you drop the = 0 part and build a vector out of the rest,
[L1(x) - R1(x);
L2(x) - R2(x)]
and wrap it in an anonymous function
F = @(x) [L1(x) - R1(x);
L2(x) - R2(x)]
and now you have a function that you can pass to a numeric root-finder such as fsolve .
fsolve() has several algorithms. Estimates of the jacobian might be used to figure out which direction to go in.
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!