Solving algebraic equations without using symbolic variables
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Aleem Andrew
am 11 Feb. 2022
Kommentiert: Aleem Andrew
am 11 Feb. 2022
How do you solve an algebraic equation like x+y=2 for x without using symbolic variables - for example by defining a function handle y = 1; f = @(x) x+y and setting it equal to 2? Y's value is known so only x needs to be found.
2 Kommentare
David Hill
am 11 Feb. 2022
Your question is trival. I have a hard time understanding your question.
y=1;
x=2-y;%x==1
Akzeptierte Antwort
Steven Lord
am 11 Feb. 2022
For one equation in one unknown, use fzero.
y = 1;
f = @(x) x + y;
initialGuess = 42;
% Find a zero of f(x) - 2 = 0 which is equivalent to f(x) = 2
x = fzero(@(x) f(x) - 2, initialGuess)
check = f(x) % Should be close to 2
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Calculus 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!