matlab - 使用存储在变量 Matlab 中的方程
问题描述
我想使用一个使用内联函数存储在变量中的方程,但我收到错误“检查不正确的参数数据类型或在调用函数‘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]
谢谢。
解决方案
使用以下代码:
syms x
eq = input('Enter Equation Of Divisor: ');
c = coeffs(eq);
disp(c)
推荐阅读
- php - 如何安装特定版本的 Symfony?
- sql - 项目状态表推导SQL逻辑
- laravel - Laravel 中的 DRY 编码 7+
- eclipse - Eclipse 中的某些文件显示为灰色/没有语法着色/无法识别函数
- php - 更新 laravel 版本后出现 Api“401 - 未验证”错误
- python-3.x - 从我的 wordcloud 中排除无趣的单词我缺少什么?
- python-requests - 如何使用 python 从远程链接中提取 tar.gz 文件
- javascript - 连接两个 AJAX 请求返回到 1 个数组
- installation - 在 SDM845 上使用 Android Things 控制板载 LED
- c# - 无效的资源字典 clr 命名空间