08-25-2014 10:07 AM
Hey guys I am currently working on some code that should interpolate a 2D array.
I care about two columns for the interpolation one is the "Tesla" column and one is the "EMU" column. The way the data works is that the Tesla values will go on a loop from -2 to 14 then back to -2. So in essence this could be broken up into a Field up and Field down. What I need to do is get the amplitude of the graph, I need to do this by using the points on the field up and interpolating these values with the field down EMU values so the Field/Tesla points could match up on the way up and down and I could use the corresponding EMU values.
Attached are the dummy file and the labview code.
All help is appreciated, thank you guys
Solved! Go to Solution.
08-25-2014 12:10 PM - edited 08-25-2014 12:11 PM
Convert your 2D array to an array of points, then use interpolate array.
See here: http://forums.ni.com/t5/LabVIEW/measure-percentage/m-p/2953749#M852011
(Sorry, posting by phone, cannot see your code)
08-25-2014 01:14 PM
I believe I am doing that in my code, I could be wrong though
08-25-2014 02:05 PM
interpolate?
It sounds more like you want to merge two sets of data and sort them in order.
At least that is what it sounds like to me.
08-25-2014 04:01 PM - edited 08-25-2014 04:02 PM
OK, looking at the code now, it seem there are major problems.
Sorry, I simply don't "get" it. What is the final output you expect?
08-26-2014 12:13 PM
so my expected output is matching points for field on the way up and down, I need matching field values in order to get the corresponding EMU value for further data analysis. the reason I have to do this is because my field values on the way up and down do not match up although they are very close to each other.
I appreciate all the help, I havent had much work with file I/O and arrays using labview
08-26-2014 12:46 PM - edited 08-26-2014 12:47 PM
@julianv23 wrote:
- I am writing false so that the button that breaks the loop gets initialized as a false
If you want to initialize the button, this needs to happen before the loop. The correct solution would be to change the mechanical action to latch when released (right-click..mechanical action). This way it is true when you press it but reverts to FALSE automatically once the value has been read by the code. No property node needed.
@julianv23 wrote:
- so my expected output is matching points for field on the way up and down, I need matching field values in order to get the corresponding EMU value for further data analysis. the reason I have to do this is because my field values on the way up and down do not match up although they are very close to each other.
Sorry, I just don't get your description, too diffuse. What is "matching" in this context? What is the expected output? Do you want to fold the ramp-down values into the ramp-up parts?
08-26-2014 12:55 PM
Just for reference, here's how you would read the file to get the same output as you currently do.
You still need to explain what you want for the missing output.
08-26-2014 01:00 PM
So lets say my array looks like this
Field = [ 1, 2, 3, 4, 5, 4.6, 3.6, 2.6, 1.6]
EMU = [ 1.1, 1.3, 1.5, 1.7, 1.9, 1.8, 1.6, 1.4, 1.2]
I would like to get the corresponding EMU values for a certain field. For example, if I input the array above, I would want my interpolation to give me an array looking like this
Field = [ 1, 2, 3, 4, 5, 4, 3, 2, 1]
EMU = [ 1.1, 1.3, 1.5, 1.7, 1.9, Yi, Yi, Yi, Yi]
In other words, I want to use the field value on the way up and interpolate these values with the data for the field down in order to get matching EMU values at certain fields. This will allowme to make a delta EMU calculation.
08-26-2014 01:36 PM