在 MATLAB 中对相似项进行分组
我正在尝试编写一个程序来求解 MATLAB 中的方程组。我想知道是否有办法让 MATLAB 将类似项分组并将它们的系数放入矩阵中?我意识到我可以手动输入系数,但我希望重新利用这个小程序来执行节点分析。
I'm trying to code a program that solves systems of equations in MATLAB. I was wondering if there is a way to get MATLAB to group like terms and put their coefficients into a matrix? I realize that I can just enter the coefficients in by hand but I want to hopefully repurpose this small program to perform nodal analysis.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您始终可以使用我的 sympoly 工具为您完成大部分工作。由于这套工具可以让您直接访问解析结果,这将使您的生活变得更轻松,并对表达式进行许多符号操作。例如...
在文件交换中查找 sympoly。
You could always use my sympoly tools to do much of the work for you. Since this set of tools will give you direct access to the parsed result, this will make your life easier, as well as do much symbolic manipulation of an expression. For example...
Find sympoly on the file exchange.
编写一个解析器来自己完成此功能是很容易的。解析出数字,然后解析出变量及其幂。祝你好运。
It would be easy enough to write a parser in order to do this functionality yourself. Parse out the number and then the variable with its power. Good luck.