I am trying to plot a graph using the following code in MATLAB
pressure = linspace(10,2000,1000);
eqn = ((nh^2)/(1-nh))*(pressure*0.0680459639) == 0.136;
y1 = max(vpa(solve(eqn, nh)));
figure(2)
scatter(presssure, y1)
hold on
plot(pressure, 1-y1)
hold off
But this error showed up: "Input arguments must be convertible to floating-point numbers." for
y1 = max(vpa(solve(eqn, nh)));
Could you help me figure out what is wrong with my code and whether I can plot a graph this way? Thank you!
Edit: After I split it into "solve":
pressure = linspace(10,2000,1000);
eqn = ((nh^2)/(1-nh))*(pressure*0.0680459639) == 0.136;
y1 = solve(eqn, nh);
Warning: Solutions are parameterized by the symbols: z. To include parameters and conditions in the solution, specify the 'ReturnConditions' value as 'true'.
In sym/solve>warnIfParams (line 475) In sym/solve (line 357) In ae433hw5 (line 31) Warning: Solutions are only valid under certain conditions. To include parameters and conditions in the solution, specify the 'ReturnConditions' value as 'true'. In sym/solve>warnIfParams (line 478) In sym/solve (line 357) In ae433hw5 (line 31)