How to create a function with symbolic variable tools
이전 댓글 표시
Hello Please How can I create a function with symbolic variabls, I linearised my nonlinear system using symbolic tools in matlab and I need to extract the ABCD matrices in another script to obtain a transfer function because som of my parameters change and I want the transfer function to recognise the changes. I already did the linearization but I need it as a function rather than a script.
Thanks
댓글 수: 4
madhan ravi
2020년 5월 18일
Can you upload the code?
Patience Shamaki
2020년 5월 18일
편집: Walter Roberson
2020년 5월 18일
Walter Roberson
2020년 5월 18일
What would the inputs be?
Walter Roberson
2020년 5월 19일
A.eval = eval(A.algebraic);
Do not use eval() with symbolic expressions.
eval() applied to a symbolic expression is treated as eval(char()) of the expression . That is a problem because the language used by symbolic expressions is not exactly the same as non-symbolic MATLAB and you will get subtle errors.
What you should do instead is
A.eval = double(A.algebraic);
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!