bbfun = @(x1,x2) (4-2.1.*x1.^2+x1.^4/3).*x1.^2 + x1.*x2 + (-4+4*x2.^2) .*x2.^2; x1 = -2:1/100:2;x2 = -1.5:1/100:1.5;pltvar = bbfun(x1,x2);contour(x1,x2,pltvar,20)
Error:
Matrix dimensions must agree.
Error in q2_a>@(x1,x2)(4-2.1*x1.^2+x1.^4/3).*x1.^2+x1.*x2+(-4+4*x2.^2).*x2.^2
Error in q2_a (line 5)
pltvar = bbfun(x1,x2);
Why am I getting this error? What am I doing wrong?
Best Answer