I have a function:
function [y, Grad, Hess] = Target(x)
where x's size is 4 (a vector of 4 variables).
How to plot a contour of Target() using a meshgrid of two variables? Something like this code:
xC1 = linspace(0.1, 1.9);
yR1 = linspace(0.1, 1.9);
[XC1, YR1] = meshgrid(xC1, yR1);
% this is wrong: [Z, ~, ~] = Target([XC1, 1, YR1, 1]); how to do it right?
contour(XC1, YR1, Z)