Find the minimum of a multi-variable function
40 views (last 30 days)
Show older comments
Question: Find the minimum of in the window [0,2]×[2,4] with increment 0.01 for x and y.
syms fun(x,y) fx(x,y) fy(x,y) fxy(x,y) x y
pt=solve([==0,==0],[x y]) But it gives me an error.
besides what about the window and increment mentioned that question. Any solution will be appreciated .
Thanks in advance .
infinity on 23 Jun 2019
Edited: infinity on 23 Jun 2019
In your code, it was not good to put the name like "fun(x,y)". Also, we do not need to declare "fx, fun, fy,.." as symbolic variable. Here is a small code that you can refer
syms x y
sol = struct2array(pt)
It will give us the solution
[ 1, 3]
I have run this code on Matlab2018a. Maybe in your Matlab version, there will be some different.
More Answers (0)
Find more on Function Creation 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!