# MATLAB: How to parameterise a function

fminsearchfunctionfunctions

I was trying to use a multi-variable function in commands that take functions as inputs but kept getting errors and was told to parameterise the function but not sure how. The function is f(x,y,z) = x^2 + 3y^2 + 4z^2 – 2xy + 5x – 3y + 2z. I tried doing:
f = @(x,y,z) = x.^2 + 3.*y.^2 + 4.*z.^2 - 2.*x.*y + 5.*x - 3.*y + 2.*z;ezplot(f)fminsearch(f,[0,0,0])
and was told to parameterise my functions so that x(1)=x, x(2)=y… Not sure how to continue though. Please help

g = @(V) = V(1).^2 + 3.*V(2).^2 + 4.*V(3).^2 - 2.*V(1).*V(2) + 5.*V(1) - 3.*V(2) + 2.*V(3);
f = @(x,y,z) = x.^2 + 3.*y.^2 + 4.*z.^2 - 2.*x.*y + 5.*x - 3.*y + 2.*z;g = @(V) f(V(1),V(2),V(3));