LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate 2D array pattern efficiently

Solved!
Go to solution

I created this for loop 

to create a pattern in a 2D array that looks like this (for N=5):

012345

112345

222345

333345

444445

555555

Is there a more efficient way of doing the same thing: Input any N and get the above shown matrix pattern?

 

I appreciate any guidance on this subject!

Thank you.

0 Kudos
Message 1 of 5
(199 Views)
Highlighted
Solution
Accepted by mmkay
Message 2 of 5
(189 Views)

Genius! Haha. 

 

Thank you!

0 Kudos
Message 3 of 5
(175 Views)

Separating the two loops gives me another factor of 2 in speed.

0 Kudos
Message 4 of 5
(105 Views)

Hi Nambu,

 

for which value of "N"?

(Have you tried to use loop parallelism for large values of N? With disabled debugging options?)

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 5 of 5
(100 Views)