MATLAB示例失败

编程入门 行业动态 更新时间:2024-10-28 04:28:24
本文介绍了MATLAB示例失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我丝毫不知道这里发生了什么,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示例失败

本文发布于:2023-11-23 08:52:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1620825.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:示例   MATLAB

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!