I'm trying to replicate the following plot in Matlab, minus the zigzagging line.
I know that this is a two-dimensional quadratic function y = x1^2 + 10 * x2^2.
My best attempt is with
fcontour(@(x1, x2) x1.^2 + 10*x2.^2)
xlim([-60, 60])
ylim([-60, 60])
but this results in a graph like this:
In another attempt, I save the contour plot and set the range on it as follows:
handle = fcontour(@(x1, x2) x1.^2 + 10*x2.^2)
handle.YRange = [-60, 60]
handle.XRange = [-60, 60]
This results in a slightly better plot colorwise, but it's still not right.
How do I fix my code to arrive at the first plot?



