07-25-2013 03:13 PM
I need to convert the Threshold 1D Array Function to C code. Has anyone ever done this? I've been searching around internet but I've had no luck, and I don't program. Thanks.
07-26-2013 07:51 AM
Nothing?
07-26-2013 09:05 AM - edited 07-26-2013 10:30 AM
Well, that threshold array function is polymorphic and accepts quite a few different inputs (1D array of DBL, 1D array of point clusters, etc.) so you first need to decide which one you need.
Sorry, I don't do C, but I probably could write equivalent LabVIEW code quite easily in a few minutes. Where do you have problems?
(Basically:
Threshold array: you go through the array and find the first element that is larger than the threshold, then do a linear interpolation between that and the previous element. Add some extra code to deal with edge cases.
Interpolate array: Get elements at the fractional index rounded up and down to the nearest integer and interpolate linearly to the fractional part of the index input.)