Ceate a vector of state space variable like A=[x(1), x(2), x(3),.....x(21)]
古いコメントを表示
Hi...
How can I create a vector of state space variables by a loop to get
[x(1), x(2), x(3),.....x(21)]
I need this vector to use it in ODE15 as state space variables vector multiplied by other matrices forming DAEs.
Thanks
12 件のコメント
Andrew Newell
2015 年 3 月 15 日
What vector do you want to create?
Andrew Newell
2015 年 3 月 15 日
編集済み: Andrew Newell
2015 年 3 月 15 日
ismaeel, I think you're barking up the wrong tree. As John D'Errico points out below, the ODE suite accept numeric objects and function handles, not symbolic objects.
As far as I can tell from your description of this problem, what you're really after is a function M = MASS(t,y) for the mass matrix, where t is time and y is the state vector. If I'm wrong, you'll need to add more detail about what you're trying to do and how you're trying to do it.
Jan
2015 年 3 月 15 日
When you have expressions like x(1) to x(21), the "x" is a vector already. Therefore I still do not understand what you want to achieve. When Matlab does not match your needs directly, try to use Matlab as it is designed to solve your problem.
Ismaeel
2015 年 3 月 15 日
編集済み: Andrew Newell
2015 年 3 月 15 日
Andrew Newell
2015 年 3 月 15 日
So do you want to turn the function output into something like this?
Out = M * x;
And if so, are you wondering how to formulate it as a matrix equation, import M into the function, or both?
Ismaeel
2015 年 3 月 15 日
Ismaeel
2015 年 3 月 16 日
Andrew Newell
2015 年 3 月 16 日
編集済み: Andrew Newell
2015 年 3 月 16 日
That gives you
x =
x(sqrt(-1))
x(2)
x(3)
x(4)
x(5)
x(6)
x(7)
x(8)
x(9)
x(10)
I don't see how that helps - even if the first entry were x(1).
Andrew Newell
2015 年 3 月 16 日
But again, how do you get from there to solving
dx / dt = M(t)*x + b?
採用された回答
その他の回答 (1 件)
カテゴリ
ヘルプ センター および File Exchange で Number Theory についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
