# 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 Apr 12 '16 at 5:01
• I have rephrased the question. Please have a look. – Ajay Agarwal Apr 12 '16 at 8:48
• $P(z)$ is always maximum for $z=\mu$. You need to find $x,y$ such that $\mu(x,y)=z$. – MBaz Apr 12 '16 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. Apr 12 '16 at 14:59

[argvalue, argmin] = min(x);

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