MATLAB: Undefined function or variable ‘x’.

double == vs. single =undefined function or variable 'x'.

clear;
xmin= -1;
xmax = 1;
ymin = -1;
ymax = 1;
step = 0.1;
Q1 = 1e-9;
Q2 = -1e-9;
e0= 8.854187817e-12;
[x, y] == meshgrid(xmin: step: xmax, xmin: step: xmax);

Best Answer

You are comparing the array [x, y] to the array returned from meshgrid(), however there is no x or y yet. I think you meant to use a single =:
[x, y] = meshgrid(xmin: step: xmax, xmin: step: xmax);