I have an array of anonymous functions (2x2 array, 4 functions, each with 2 variables, x1 and x2) and I want to evaluate all 4 functions at the points x1 and x2 without extracting them and doing them individually. Is there any way to do this?
Show older comments
specifically:
J = {@(x1) 8*x1 - 20, @(x2) x2/2; @(x2) x2/2 + 2, @(x1) 1/2*x1 - 5}
and I want this evaluated at say x1 = 1 and x2 = 2 and get something back that looks like
Jeval = [-12 1; 2 -4.5]
Accepted Answer
More Answers (0)
Categories
Find more on Workspace Variables and MAT Files 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!