Choose order of input variables for matlabFunction
Afficher commentaires plus anciens
Is there a way to choose the ordering of the input variables when using matlabFunction on a symbolic expression?
I would like to use exactly those names for my symbolic variables as it makes it easier for me to follow along with the theory (backward Euler on Hamiltonian system - I have simplified my function to isolate the issue).
syms p11 p12 q11 q12 p01 p02 q01 q02
F = [p11; p12; q11; q12] - [p01; p02; q01; q02];
F = matlabFunction(F);
What I would like:
F =@(p11, p12, q11, q12, p01, p02, q01, q02) ...
What I get:
F =@(p01, p02, p11, p12, q01, q02, q11, q12) ...
Is there a better solution than the following?
FF =@(p11, p12, q11, q12, p01, p02, q01, q02) F(p01, p02, p11, p12, q01, q02, q11, q12);
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Symbolic Math Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!