我丝毫不知道这里发生了什么,Google也没有提供任何有趣的帮助.我从 www.mathworks/help中获取了以下示例/toolbox/symbolic/solve.html#inputarg_eqn
I don't have the slightest idea what's going on here, and Google provides no interesting help. I took the following example from www.mathworks/help/toolbox/symbolic/solve.html#inputarg_eqn
>> syms x >> solve(x^2 + 4*x + 1 == 0) ??? Error using ==> char Conversion to char from logical is not possible. Error in ==> solve>getEqns at 169 vc = char(v); Error in ==> solve at 67 [eqns,vars] = getEqns(varargin{:});这是怎么回事?
推荐答案您正在阅读的文档不适用于您的MatLab版本.例如,我可以在2008b中重现您的错误.
The documentation you're reading doesn't apply to your version of MatLab. I can reproduce your error in 2008b, for example.
较早的文档说:
请注意,这些示例均采用f(x) = 0形式的方程式.如果需要求解形式为f(x) = q(x)的方程式,则必须使用带引号的字符串.特别是命令
Note that these examples assume equations of the form f(x) = 0. If you need to solve equations of the form f(x) = q(x), you must use quoted strings. In particular, the command s = solve('cos(2*x)+sin(x)=1')
将来,请注意每个MatLab在线文档页面顶部的行,其中指出了文档适用的版本.
In the future, pay attention to the line at the top of every MatLab online documentation page where it says what version the documentation applies to.
更多推荐
MATLAB示例失败
发布评论