Value must be a double scalar error in matlab app designer?

2 ビュー (過去 30 日間)
Robert Pritchard
Robert Pritchard 2019 年 4 月 2 日
I am working on making a simple solver in matlab app designer and keep getting the error that the value must be a double standard and have no clue why it wouldnt be. When i run it just using the equation instead it works fine but i want to use the solver so I can add some more difficult equations.
value = app.CalculateButton.Value;
X=app.UnknownVariableListBox.Value
R=8.314
P=app.PressurePaEditField.Value
n=app.MolesEditField.Value
T=app.TemperatureKEditField.Value
V=app.Volumem3EditField.Value
eqn= P*V == n*R*T
if strcmp(X,'Volume')
syms V
V=solve(eqn,V);
V=double(V)
% V=n.*R.*T./P
app.Volumem3EditField.Value=V

回答 (0 件)

カテゴリ

Help Center および File ExchangeNumerical Integration and Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by