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

1 view (last 30 days)
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

Accepted Answer

John D'Errico
John D'Errico on 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
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])

More Answers (0)

Community Treasure Hunt

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

Start Hunting!