04-21-2009 10:24 AM
Hi everyone,
Could anyone give me idea on how to get the number of elements in an Array (not number of rows) ?
I tried to find that in both property node and array functions but nothing.
Thanks,
-Kun
04-21-2009 10:29 AM
04-21-2009 11:26 AM
My array is a one-dimension one.
I tried that 'Array size' functinon but it return some giant number. Is there any other way to do it besides this?
04-21-2009 11:29 AM
That giant number should be the number of elements in your array. Are you looking for the number of non-zero elements or the number of elements that meet a certain criteria?
Maybe you could post your code?
04-21-2009 11:39 AM - edited 04-21-2009 11:40 AM
You are going to have to provide some proof that the Array Size does not work correctly. Right click on the input to it and select 'Create Indicator'. Run the VI. Go to the front panel and select 'Edit>Make Current Values Default'. Save the VI and attach it to your post.
You can also check the array size yourself. Right click on the index display of the array and select 'Advanced>Show Last Element'. I will bet you that number shown is equal to Array Size -1.
p.s. The number of elements in an array is equal to the number of rows in a 1D array. If you define the number of elements as anything else, you are mistaken.
04-21-2009 01:09 PM
Also don't forget that the array size depends on the data and is completely unrelated to the number of visible elements on the front panel.
Where does the array come from? What is the actual value of the "giant number"? Can you show us some code?