Find combinations of two variables in functions which must equal certain value

1 回表示 (過去 30 日間)
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:
1.PNG

採用された回答

John D'Errico
John D'Errico 2019 年 8 月 5 日
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
untitled.jpg
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 件)

カテゴリ

Help Center および File ExchangeNumber Theory についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by