10-05-2022 09:52 AM
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.
10-05-2022 09:53 AM
omg, of course with Labview 😄
10-06-2022 12:55 PM - edited 10-06-2022 01:02 PM
Any unwired index with be one higher as the one right above it, Recursively.
(Of course on the first iteration, your top index will be -1 (i.e. invalid), so do some testing to see what happens. :D)
10-06-2022 03:35 PM - edited 10-06-2022 03:37 PM
@altenbach wrote:
Any unwired index with be one higher as the one right above it, Recursively.
(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...
10-06-2022 03:57 PM - edited 10-07-2022 12:15 PM
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. 😄
10-07-2022 12:14 PM