Ceate a vector of state space variable like A=[x(1), x(2), x(3),.....x(21)]
조회 수: 3 (최근 30일)
이전 댓글 표시
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월 16일
But again, how do you get from there to solving
dx / dt = M(t)*x + b?
채택된 답변
John D'Errico
2015년 3월 15일
편집: John D'Errico
2015년 3월 15일
The problem is, you apparently do not appreciate the basics of MATLAB.
One does not create a vector of (symbolic) variables to use in a tool like ode15s. ode15s takes a vector of NUMERIC starting values. It then returns a predicted solution based on the equations you pose, at a given set of times.
There are no symbolic variables that you need to create or define or allocate here. Really, it is best that you start reading the basic tutorials about variables and how to call functions, etc. These are fundamental concepts in MATLAB.
Regardless, as the help for sym indicates:
A = sym('A',[M N])
This creates M-by-N vectors or matrices of symbolic scalar variables.
댓글 수: 4
John D'Errico
2015년 3월 15일
Well, whatever your goal, why not use sym? From the help...
A = sym('A',[M N]) creates M-by-N vectors or matrices of symbolic scalar
variables...
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Special Functions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!