LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array indexing

Hi,
I have a 2D array and i want to go through it such that when it hits 3 non-zero numbers it would skip 3 rows and 3 columns and then continue going through the array.

(i.e if the third non-zero number is at a[3][2] then i would continue going through the array at a[6][5])

 

something like:

 

if (count == 3)

{

    i= i+3;
    j= j+3;

}

else

{

   i++;

   j++;

}

This is just an example where i and j are your indices for your row and column.
Thus, I was wondering how something like this would be implemented within labview.

 

Your help is much appreciated.

Thanks in advance! 🙂

0 Kudos
Message 1 of 4
(2,326 Views)

If you don't know LabVIEW, take a tutorial.

 

Attempt to show that you tried by posting your own VI, instead asking someone how to do this homework problem for you.

 

 

0 Kudos
Message 2 of 4
(2,321 Views)

Hi,

 

after using LabVIEW for some weeks now you should have gone through some tutorials and you should have had time to look at examples coming with LabVIEW.

 

That said I recommend to use shift registers and the IndexArray function...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 4
(2,316 Views)

Well, I have no idea what "going through an array" actually means.

 

What is the order (column first, row first)? Do the three zeroes need to be adjacent? What is it supposed to do with the values or indices of the skipped or non-skipped elements? If they are not processed or retained in some way, the entire exercise seems to be useless. What should the final output be?

0 Kudos
Message 4 of 4
(2,300 Views)