How can I calculate those two simultaneously?

1 view (last 30 days)
a = -8.2 * 10^-7;
b = 0.65;
Wempty = a*Wto +b;
Wto = (2240 + 246)/(1 - 0.1685 - Wempty);
display(Wempty)
display(Wto)
This is my code and I do not get any answer, and no error as well.

Accepted Answer

Image Analyst
Image Analyst on 10 Nov 2019
You should have gotten this error because you did not assign Wto to anything before you tried to use it:
Undefined function or variable 'Wto'.
Error in test5 (line 3)
Wempty = a*Wto +b;
Please give us your entire code.
MATLAB will do exactly what you tell it to do. For example, if you assign Wto to something (like 10) before you use it, this code gives you a result with no error:
a = -8.2 * 10^-7;
b = 0.65;
Wto = 10
Wempty = a*Wto +b;
Wto = (2240 + 246)/(1 - 0.1685 - Wempty);
display(Wempty)
display(Wto)

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!