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
(2,342 Views)
Solution
Accepted by johndoe108
Message 2 of 5
(2,332 Views)

Genius! Haha. 

 

Thank you!

0 Kudos
Message 3 of 5
(2,318 Views)

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

0 Kudos
Message 4 of 5
(2,248 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


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