Derivatives of Cost Function for Minimizing
1 view (last 30 days)
Show older comments
Hi, I have this Cost Function H = 1/(deltaX)^2 [(A2 - A1)^2 + (A3 - A2)^2 + (A4 - A3)^2] I'd like to minimize this cost function by forming the derivatives of our function's variable. So here we have:
dH/dA1 = 2/(deltaX)^2 * ( - A2 + A1)
dH/dA2 = 2/(deltaX)^2 * (-A1 + 2A2 - A3)
dH/dA3 = 2/(deltaX)^2 * (-A2 + 2A3 - A4)
dH/dA4 = 2/(deltaX)^2 * (A4 - A3)
I need to write MATLAB code for above example. I thank you If someone help me in this regards,
Best Regards,
0 Comments
Answers (2)
Torsten
on 26 Jan 2015
If you take a look at your cost function, I can tell you without taking any derivatives that all vectors (A1,A2,A3,A4)=(c,c,c,c) for c in IR minimize your cost function.
Best wishes
Torsten.
0 Comments
See Also
Categories
Find more on Get Started with Optimization Toolbox 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!