From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
08-06-2018 05:27 AM
hello,
i am having problem in programming of extracting one value(particular element) from an array with a given condition which is dependent on the another array.
for example, lets say i have a set of data from -1v to 1v with their corresponding current . all these data voltage and current are in a two different array .
now if i want to get an element in current corresponding to which the element value in voltage array is zero.how do we find that?
i tried to put in a way as we do in c with two nested loop but here i am not able to do it here.please anyone help me out of it.atleast give a initial 2-3 steps what to do.
Solved! Go to Solution.
08-06-2018 05:34 AM
Search the voltage array to return the index of the match then use the index to select the item from the second array. Simple! or am I misunderstanding your problem
Ken
08-06-2018 05:37 AM - edited 08-06-2018 05:39 AM
08-06-2018 05:42 AM
but what if i am not getting the exact value of it say i want current when voltage is 2 V BUT IN DATA its slightly greater than or less than it,then how to solve this
08-06-2018 06:05 AM
Hi iyot,
what if i am not getting the exact value of it say i want current when voltage is 2 V BUT IN DATA its slightly greater than or less than it,then how to solve this
Use the suggestion from my previous post!
It will interpolate (using the Interpolate1DArray function) between the points defined in those voltage/current arrays. Any outliers are limited to min/max of your point array(s).
08-06-2018 06:17 AM
thanks a lot 🙂
08-06-2018 11:20 AM
well,its not giving the value as required.in short the way you suggested is not working
08-06-2018 12:23 PM
What Gerd told will work if written correctly.
If your code is not working then there is trouble with your code. Unfortunatly my eye are getting old and I can not quite make out what you have coded from where I am sitting.
Show us the code.
Ben