Choose order of input variables for matlabFunction
13 views (last 30 days)
Show older comments
Lukas-Marie Jean Stanislas Gamard
on 7 Feb 2022
Answered: Steven Lord
on 7 Feb 2022
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);
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Assumptions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!