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 个评论

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.
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’).
Thank you both for your help! Using "syms" solved my problem. I didn't realize I had to define each variable before I created my matrices. Thanks again!

请先登录,再进行评论。

回答(0 个)

类别

提问:

Vin
2017-4-24

评论:

Vin
2017-4-24

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by