02-26-2010 04:46 AM
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).
Solved! Go to Solution.
02-26-2010 05:10 AM
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.
02-26-2010 05:51 AM
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..
02-26-2010 07:55 AM
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.
02-26-2010 07:55 PM
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,
03-01-2010 06:55 AM
03-01-2010 07:05 AM
I do not know why but the second file "interp_test_2.vi" is said to have been made using lv 8.6
03-01-2010 07:48 AM
03-02-2010 03:29 AM
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.
03-02-2010 04:09 AM
Thanks aeastet!
I just need to change the method into bilinear and I have what I want.