keeping equations in different formats
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Gil maor
am 1 Aug. 2017
Beantwortet: Gil maor
am 3 Aug. 2017
Hello All.
I have a problem. In my project I have three equations which in times I use with symbolic analysis and some times with numerical values. The problem is that I cannot keep the equations as syms due to the following reasons:
1. I need to always change update the syms in different parts of the code and functions 2. Using subs or eval commands take a lot of time mainly when I use loops to change the values.
Is there a way that I could have the equations saved and call them at symbolic form or numerical form and change the variables without using subs/eval?
Thanks!
Gil,
8 Kommentare
Karan Gill
am 2 Aug. 2017
If you want to save/load equations, then use MAT files: https://www.mathworks.com/help/matlab/matlab_env/save-load-and-delete-workspace-variables.html
Of course, that won't work if your numeric values keep changing. You'll have to use subs. Can you provide an example where subs is too slow?
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 3 Aug. 2017
I suggest that you could keep a struct, one field of which is the symbolic form, and another is the result of calling matlabFunction to transform the symbolic form to a function handle for numeric work.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Assumptions finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!