From: Khawla Hadi Abed on
??? Error using ==> contour at 73
The size of X must match the size of Z or the number of columns of Z.

Error in ==> test at 25
contour(x2,y2, M ,[0.2 0.4 0.6 0.8 1 1.2])
From: Wayne King on
"Khawla Hadi Abed" <khawla_h1(a)hotmail.com> wrote in message <hphthl$oq0$1(a)fred.mathworks.com>...
> ??? Error using ==> contour at 73
> The size of X must match the size of Z or the number of columns of Z.
>
> Error in ==> test at 25
> contour(x2,y2, M ,[0.2 0.4 0.6 0.8 1 1.2])

What are the dimensions of your x2, y2, and M variables? You've got a size mismatch between your x2 and M variables. For example:

Z = peaks;
contour(1:size(Z,1),1:size(Z,2),Z);
% is ok, but
contour(1:size(Z,1)-1,1:size(Z,2),Z);


generates the error that you're seeing.

Wayne