【问题标题】:Using equation stored in variable Matlab使用存储在变量 Matlab 中的方程
【发布时间】:2021-11-04 04:22:32
【问题描述】:

我想使用一个方程式,该方程式使用内联函数存储在变量中,但我收到错误“检查不正确的参数数据类型或在调用函数'coeffs'时缺少参数”。 '。这是我想要的代码和输出。 MATLAB

syms x;
eq = input('Enter Equation Of Divisor: ','s');
p = inline(eq);
c = coeffs(p);
disp(c);
> Enter Equation: x-4
> [-4,1]

谢谢。

【问题讨论】:

  • 如果您阅读了 MATLAB 的帮助部分,建议不要使用内联函数,而是使用其他匿名函数。

标签: matlab printf equation coefficients


【解决方案1】:

使用以下代码:

syms x
eq = input('Enter Equation Of Divisor: ');
c = coeffs(eq);
disp(c)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-04-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-26
    • 1970-01-01
    相关资源
    最近更新 更多