From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
JackDunaway

Randomize Array

Status: New

A common need that comes up is the ability to randomize an array, yet there is no primitive that handles this. There are of course a few homebrew solutions, but it's tough to beat a primitive that accepts any dimension or datatype in terms of syntax and execution speed!

 

17359iAF869714800E9778

 

Note: This is not an Idea to create an array of random numbers, it only deals with taking an already initialized array and scrambling the locations of the elements.

12 Comments
AristosQueue (NI)
NI Employee (retired)

Ok. You asked. Here you go:

Now available for download: Randomize 1D Array.vi that accepts any array type

 

I just posted this to the LabVIEW Developers Feature Brainstorming forum. It's a good test of something that's been bubbling in the R&D stew for a while. If you find it helpful, I'll check into adding it to the palettes in LV 2011.

PhillipBrooks
Active Participant

The Riffle function solution requires the Full Development System. Smiley Sad

 

This sort operation seems generic enough to me that it should be part of the base package. As long as the Randomize 1D Array.vi doesn't require the FDS, it would be nice to have on the palettes for LV 2011.


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness