LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2D interpolation of non-evenly spaced data

I am trying to use the 2D Interpolation VIs to generate a contour map of my X,Y,Z data much like the 'griddata' function in Matlab. I don't know how to format the Z matrix when I have unevenly spaced data in X or Y. Some rows have more Z data in them than others. The help is a little mistifying, any suggestions?
 
I have attached a sample data set here. This data is scattered about X and Y, I'd like to generate an ordered 100x100 matrix using the 2D interpolation vis.
 
Thanks.
 
0 Kudos
Message 1 of 21
(7,165 Views)
Hello,
 
How are you generating your Z data?  This data has to be dependent on the other two variable in some way. Also, notice that both the Y array and the X array have to be formatted as instructed in the help file (see attached VI)
 
In general, having uneven spaced data is not a limitation.  However, if you provide more information regarding the way by which you are creating your Z array, I should be able to further help with this issue.
 
Regards,
AG
0 Kudos
Message 2 of 21
(7,144 Views)
didn't save values.. this VI's better 🙂
 
AG
0 Kudos
Message 3 of 21
(7,140 Views)

AG -

Thanks for the VI. I do understand that the X and Y data need to be monotonically increasing and formatted as a mesh as you showed me in your VI. However, the problem I run into is when generating the Z matrix. I have scattered points that have been measured in different X and Y locations, and do not represent a regular 2D grid. Sometimes the data is measured in a few points around a circle, for instance, but I want to interpolate over a rectangle containing the circle.

So, my Z data looks like this (see attached image):

 

Which I can write as a 1-D array into the griddata function in matlab

0 Kudos
Message 4 of 21
(7,119 Views)

Hello,

I am in the process of discussing this issue with R&D.  They are aware of the difficulty such a problem creates, and should get back with me soon.  I will let you know either way as soon as I hear back.

Thanks for your patience,

AG,

National instruments

0 Kudos
Message 5 of 21
(7,095 Views)

AG -

I appreciate you taking the time to look into this. Right now, I'm using the Matlab node to run griddata in my LV code. Of course, I would rather have a way to do it in 100% LabVIEW (without writing my own griddata function).

thanks.

0 Kudos
Message 6 of 21
(7,084 Views)
I understand.  I'll get back with you as soon as I have something.
 
Have a good weekend! 🙂
0 Kudos
Message 7 of 21
(7,070 Views)

Good News!

Our R&D department has created this functionality in LabVIEW 8.20!  However, there are some issues associated with its help and documentation.  To fix these issues, please refer to the following link: http://digital.ni.com/public.nsf/allkb/d97af9ecd0236d6f862571d9005ea79f

If you have LabVIEW 8.0 and would like assistance executing the griddata function with it, please contact our technical support department via email by going to the following link: http://sine.ni.com/apps/utf8/nicc.call_me

I hope this helps, and apologize for the delayed response.

Best of luck,

AG, National Instruments

 

Message 8 of 21
(6,991 Views)

Wow, thanks for the response. I have 8.2, and I didn't notice griddata in the list of new functions supported by the Mathscript node. I'm not too worried about the help, since I am already using the MATL version of griddata in 8.0. I'll try it out and let you know how it works.

Thanks again, great support.

0 Kudos
Message 9 of 21
(6,979 Views)


vituning a écrit: ... I'm not too worried about the help, since I am already using the MATL version of griddata in 8.0. I'll try it out and let you know how it works.
Well, I'm not using MatLab and some help would be strongly appreciated ! Could you post an example ?
Chilly Charly    (aka CC)
0 Kudos
Message 10 of 21
(6,920 Views)