LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Nested for loop + array

Solved!
Go to solution

Dear all it is so silly task, but I'm stuck for couple of hours... trieing to migrate from Matlab to LabView 😄

Nested for loop with random number generator in the middle. How to get out array, with Loop indexes and random numbers like here...

0 0 rand
0 1 rand

0 2 rand
0 3 rand

1 0 rand
1 1 rand

1 2 rand
1 3 rand

2 0 rand
2 1 rand

2 2 rand
2 3 rand

ku_ku_0-1745669510839.png

 

 

0 Kudos
Message 1 of 4
(358 Views)
Solution
Accepted by topic author ku_ku

I think this feature is in 2015. If you right-click on the last output tunnel, you can choose Tunnel Mode->Concatenating. You then need to change you indicator to only be 2D.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 4
(356 Views)

Thank you, just two clicks and done 🙂

If there were not a concentrate feature... what was your approach to solve it?

0 Kudos
Message 3 of 4
(350 Views)

@ku_ku wrote:

If there were not a concentrate feature... what was your approach to solve it?


The old school way would be to use a Shift Register on the outside loop with a Build Array set to Concatenating mode to add to the 2D array.

 

Just to finalize this, the Concatenating Tunnel was added in 2012: https://forums.ni.com/t5/LabVIEW-Idea-Exchange/Add-a-quot-Concatenate-Indexing-quot-option-for-array... 


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 4
(339 Views)