Find combinations of two variables in functions which must equal certain value
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Morten Hansen
am 5 Aug. 2019
Beantwortet: John D'Errico
am 5 Aug. 2019
Is it possible to plot a curve of all the combinations of q=sqrt(z1z2) if q must equal 9 for the interval 0<=z1<=40?
It should look something like this:
0 Kommentare
Akzeptierte Antwort
John D'Errico
am 5 Aug. 2019
Algebra? If we have
q = 9 = sqrt(z1*z2)
then it is trivial.
z1*z2 = 9^2
So the curve is given as
z2 = 81/z1
Plotting is equally trivial.
z1 = 0.25:.25:40;
plot(z1,81./z1,'-');
xlabel z1
ylabel z2
Of course, there are no solutions when z1==0.
Do you want MATLAB to do the thinking for you?
syms z1 z2
>> EQN = sqrt(z1*z2) == 9;
z2 = solve(EQN,z2)
z2 =
81/z1
z2fun = matlabFunction(z2)
z2fun =
function_handle with value:
@(z1)8.1e+1./z1
fplot(z2fun,[0.25,40])
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Number Theory 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!