LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Diagram index array

arr.png

Hello, I am beginner with Matlab. I got the diagram. I understand everything, but not these piece. I understand index array which has input 2D array (image) and as output three values. But which values? The i-th pixel is obvious, but what means -1? and what are another two values? Thank you very much for you help. And sorry if the question is very primitive.

0 Kudos
Message 1 of 6
(1,107 Views)

omg, of course with Labview 😄

0 Kudos
Message 2 of 6
(1,106 Views)

Any unwired index with be one higher as the one right above it, Recursively.

 

altenbach_0-1665079329868.png

 

 

(Of course on the first iteration, your top index will be -1 (i.e. invalid), so do some testing to see what happens. :D)

0 Kudos
Message 3 of 6
(1,099 Views)

@altenbach wrote:

Any unwired index with be one higher as the one right above it, Recursively.

 

altenbach_0-1665079329868.png

 

 

(Of course on the first iteration, your top index will be -1 (i.e. invalid), so do some testing to see what happens. :D)


And an element outside the array bounds i.e. index -1 or > array size will return the default value for the datatype.  Empty string for strings[], 0 for numerics[], class default data for classes[], etc...


"Should be" isn't "Is" -Jay
Message 4 of 6
(1,073 Views)

We know what we get if an index is outside the range of elements, that wasn't my point.

 

My suggestion was to just test and verify what happens if the first element has -1 wired: Will the second element return the element at index 0 if unwired? What if we wire a -5 to the first index and leave the rest unwired. Will the 10th output return the element at index 5, for example? (Currently not at a computer, so I cannot test). I assume it all works just as expected. 😄

0 Kudos
Message 5 of 6
(1,068 Views)

@altenbach wrote:

I assume it all works just as expected. 😄


Yes, it does. 😄

 

altenbach_0-1665162849713.png

 

0 Kudos
Message 6 of 6
(1,030 Views)