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:
Question regarding GRIDDATA

Subject: Question regarding GRIDDATA

From: Alexandre Trudel

Date: 13 May, 2013 16:08:15

Message: 1 of 1

Hi,

I want to create a contourplot of microhardness data taken on a weld. The data is in the form of 3 vectors: 1 vector "X" containing the x coordinate, 1 vector "Y" containing the y coordinate and 1 vector "HV" containing the microhardness data for every x-y position. Here is the code used to create the contour plot:

v = [200:20:400];
X_lin=linspace(min(X),max(X),1000);
Y_lin=linspace(min(Y),max(Y),1000);
[X_grid,Y_grid]=meshgrid(X_lin,Y_lin);
HV_grid=griddata(X,Y,HV,X_grid,Y_grid,'linear');
contourf(X_grid,Y_grid,HV_grid,v)

The resulting contour plot can be seen here:

https://plus.google.com/photos/116448952174651255123/albums/5877494624930772577?authkey=CMiDorKnj82nogE

Note that the X and Y data are also plotted as blue empty circles.

My concern is that their should not be HV values outside the range delimited by X and Y but we can clearly see that this is whats happening especially at the top. It is as if the griddata function extrapolated HV values outside the range given. It this behavior normal? Also is there a way to really limit the griddata to interpolate values within the strict range given by X and Y?

Thanks!

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