How to make a function handle from variable consisting of a function
Show older comments
I have a problem like this for example.
x = sym('x',[7,1]);
phi = [ (10001*x2)/800000 - (10001*x1)/400000 + (10001*x3)/600000 - (10001*x4)/1600000 + (10001*x5)/3000000 + (10001*x6*x7)/200000];
% ** This phi was copied from output just so you see how it looks
Is there a way I can make a function handle kind of like this?
phi1 = @(x)phi
(I know this doesn't work but hopefully you get what I am trying to do) Basically I can't explicitly write out the function because it is generated from another algorithm. I don't know the syntax, or if you can even do this.
Also, can someone explain the difference between the operator @ and matlabFunction? Thanks!
Accepted Answer
More Answers (0)
Categories
Find more on Mathematics 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!