undefined function or variable s
显示 更早的评论
I am trying to solve a system of equations with many variables. I am trying to use linear algebra with Ax=b. I am having trouble creating the coefficient matrix A. These are the matrix I am trying to create:
A = [s*A + (1/(s*B)) + (1/(s*C)), 1/(s*C) ; -1/(s*C) , (1/(s*C)) + s*D + (1/E)]
x = [Va ; Vo]
b = [Vin*s*A ; 0]
When creating A I get an undefined function or variable 's' error. Is this possible with many unsolved variables? Any help would be greatly appreciated. Thank you.
3 个评论
Rik
2017-4-24
If you are trying to solve equations, at least use sym s to create s as a symbolic variable.
You can't use any undefined variables in Matlab. It needs to know what you are talking about, even if it may seem obvious to you.
I think you need to have a look at the documentation for solve, and you should have a look at some tutorial on Matlab.
Star Strider
2017-4-24
Your problem is also not linear. My guess is that you are solving for ‘A’...‘E’. ‘Linear’ is defined as ‘linear in the parameters’, meaning that the partial derivatives of your objective function with respect to each parameter are not functions of themselves or other parameters. That is not true for your ‘A’ matrix (that you need to rename if one of your parameters is also called ‘A’).
Vin
2017-4-24
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!