About summing of anonymous function
Show older comments
Hi. I'm using matlab on my research at the university and an optimization protocol which is fmincon function. Although I make the formula like, y =@(x)(x(1)+1)^2 + (x(2)+5)^2, as my research progresses, the formula will be much longer and complex. So I'd like to dismantle this function like y1=@(x)(x(1)+1)^2 + (x(2)+5)^2; y2=@(x)(x(3)+21)^2 + (x(4)+10)^2; after that , connect them like y = y1 + y2;
I tried this, but failed. Do you know how to deal with it?
Accepted Answer
More Answers (0)
Categories
Find more on 関数の基礎 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!