String to matlabFunction is there any way to replace sym('StringFunction') in R2016a
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Zine
le 26 Avr 2016
Réponse apportée : Walter Roberson
le 26 Avr 2016
I wanted to create a simple GUI that take a function edited in edit text and convert it from a string to an anonymous function to use it in optimization problem, first I planned as follows:
strg = 'a*X-bX^2+c';
symStrg = sym(strg);
funStrg = matlabFunction(symStrg);
and processed with the resulting anonymous function, but this seems to be no longer supported starting from R2016a see here ,am I right? and if yes, is there any work around to have a GUI taking edited function as string and convert it to Matlab function that can be used in optimization problem or plotting or any other staff.
0 commentaires
Réponse acceptée
Walter Roberson
le 26 Avr 2016
No, it is still supported in R2016a; it will be removed in a later release. It does emit a warning, though.
Remember, by the way, to have a multiplication between your b and your X^2
0 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!