Finding Argmax in MATLAB [closed]

I have a Gaussian random variable $z$, whose mean $\mu$ and variance $\sigma^2$ are functions of two variables $x$ and $y$. Is there any way in MATLAB so that I can find the values of $x$ and $y$ for which $P(z)$ = $N(z$;$\mu$$(x,y),\sigma$$(x,y))$ is maximised for a given value of $z$? Thanks in advance.

• I don't understand your writing. Could you rephrase it?
– Royi
Commented Apr 12, 2016 at 5:01
• I have rephrased the question. Please have a look. Commented Apr 12, 2016 at 8:48
• $P(z)$ is always maximum for $z=\mu$. You need to find $x,y$ such that $\mu(x,y)=z$.
– MBaz
Commented Apr 12, 2016 at 13:57
• As @MBaz says, $P(z)$ will be maximized when $z = \mu(x,y),$ unless there are constraints on the values of $x$ and $y$ or on the function $\mu$ that mean $z = \mu(x,y)$ is impossible. Are there any other things about the problem that you're not telling us?
– Peter K.
Commented Apr 12, 2016 at 14:59

[argvalue, argmin] = min(x);

If you can express $\mu$ in an functional form, you could use fsolve.