LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Interpolation with input from excel sheet

Solved!
Go to solution

Hi all,

 

I am trying to do this in labview 8.5 what I did in matlab.

Basically, I have two parameters x and y, and the based on f(x,y)=z

 

The data is available in excel sheet. In matlab I can just read the excel file, use the interpolation function, and I got the answer.

How can I do the same thing in lv 8.5?

 

First problem is how to read specific row and specific column in excel and import them to lv?

The value for z will be 2D array, how to import it to lv?

 

I think that for the interpolation, I can use interp2D (1D xi,yi).

0 Kudos
Message 1 of 11
(4,405 Views)

I tried as in the attachment. What I did is I save x (0,10,20,..,100) in csv file y (0,10,20,...,100) in csv. And for z it is a 2D array and I save it in csv.

I run the vi, for z, it reads only the first column.

 

Back to my first post in this thread, I would instead of having 3 csv files or text files. I prefer to have single excel file and the input for interpolation can be configured based on the cell number in excel.

 

Thank you.

Download All
0 Kudos
Message 2 of 11
(4,395 Views)

Nobody here...

 

I change the from reading the csv into reading a tab delimited file (txt)..

And the interpolation works!

 

But again.. I want to work with excel..

0 Kudos
Message 3 of 11
(4,384 Views)

What you did should work fine. If you make the delimiter a comma you should be able to read excel files with what you have done See attached.

 

If you want to work off of one file you need to tell me the format of the data so that I can help you get what you are looking for.

 

If I assume that the first column is x the second is y and the rest are z, the second attachment should work for one sheet.

Tim
GHSP
Download All
Message 4 of 11
(4,364 Views)

Thanks aeastet,

 

you are right, i want to work with excel..

Umm actually the first row is x, the first column is y and inside them is z. But I think you arrangement could work as well.

 

The thing is I cannot open your vi because mine mine is 8.5 and you have made it in 9.0

Can you attach the png or screenshot of your vi?

 

Thank you, 

0 Kudos
Message 5 of 11
(4,354 Views)
Here is 8.5 version
Tim
GHSP
Download All
Message 6 of 11
(4,331 Views)

I do not know why but the second file "interp_test_2.vi" is said to have been made using lv 8.6

 

 

0 Kudos
Message 7 of 11
(4,327 Views)
Solution
Accepted by topic author Driga
Try this
Tim
GHSP
Message 8 of 11
(4,318 Views)

I have tried your vi.

It gives the same answer as mine, but I am not yet figuring out how your vi does that.

 

The thing is the vi (both your vi and mine) do not give the correct answer.

I attached the excel file, the data come from an article. I just put it together in an excel sheet.

 

 

0 Kudos
Message 9 of 11
(4,305 Views)

Thanks aeastet!

 

I just need to change the method into bilinear and I have what I want.

  

0 Kudos
Message 10 of 11
(4,296 Views)