How to create a function with symbolic variable tools
Mostra commenti meno recenti
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 Commenti
madhan ravi
il 18 Mag 2020
Can you upload the code?
Patience Shamaki
il 18 Mag 2020
Modificato: Walter Roberson
il 18 Mag 2020
Walter Roberson
il 18 Mag 2020
What would the inputs be?
Walter Roberson
il 19 Mag 2020
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);
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Symbolic Math Toolbox in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!