Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Contour Plot

Subject: Contour Plot

From: Peta

Date: 20 May, 2010 06:00:24

Message: 1 of 2

Hello,

I keep getting an error message saying the following while I'm trying to create a contour plot:

??? Error using ==> griddata at 53
X and Y must both be vectors or both be matrices.

Error in ==> ContourData at 129
Z = griddata(x,y,z,X,Y,'cubic');

However X and Y are both matrices, they were created with meshgrid().
Could it be that they are too big? They are both <259200×18 double>.
If it's not that then can anyone please help me figure out why matlab doesn't like it?

Thanks

Peta

Subject: Contour Plot

From: John D'Errico

Date: 20 May, 2010 09:31:06

Message: 2 of 2

"Peta " <petie4u@hotmail.com> wrote in message <ht2j5o$3ji$1@fred.mathworks.com>...
> Hello,
>
> I keep getting an error message saying the following while I'm trying to create a contour plot:
>
> ??? Error using ==> griddata at 53
> X and Y must both be vectors or both be matrices.
>
> Error in ==> ContourData at 129
> Z = griddata(x,y,z,X,Y,'cubic');
>
> However X and Y are both matrices, they were created with meshgrid().
> Could it be that they are too big? They are both <259200×18 double>.
> If it's not that then can anyone please help me figure out why matlab doesn't like it?
>

Yes. But what are x and y? Look at them. READ the
help. What does griddata call the first two arguments?

John

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us