在MATLAB中,字符串转化为符号表达式需要使用sym函数而不是str2sym函数。所以正确的代码应该是:

ode = app.EditField_2.Value(); syms x y(x); eqn = sym(ode); sol = dsolve(eqn); app.TextArea2.Value = ['解析解:' char(sol)];

ode=appEditField_2Value; syms x yx; eqn = str2symodex; sol = dsolveeqn;用dsolve函数求解析解 显示结果 appTextArea2Value = 解析解: charsol;错误

原文地址: https://www.cveoy.top/t/topic/hLwH 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录