LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Random Matrix

Hi,

Is it possible to create a random 2D array in Labview?

Thank you
Amit

Message 1 of 3
(3,153 Views)
Yes!
 
If you want a flat probability distribution 0..1, use the "dice" from the numeric palette. Now simply place it inside two stacked FOR loops and wire the two N with the desired number of rows and columns. You'll get a 2D array of the desired size due to the autoindexing feature of the output tunnels. Try it!
 
For e.g. a normal distributed 2D array,  you could use the gaussian white noise from the singal generation palette. Simply create a 1D array with a size corresponding to the produce of the desired number of columns and rows, then reshape it to a 2D array.
 
There are many other ways to do this. Can you tell us a bit more about your appliaction?
 
(Of course you haven't really told us what you mean by a "random 2D array ". a 2D array of fixed size containing random numbers? A 2D array of random size?

Message Edited by altenbach on 06-25-2007 04:23 PM

Message 2 of 3
(3,152 Views)
Thanks, I wanted a random matrix of fixed size only(a 2D array of
fixed size containing random numbers).
and thanks for telling the normally distributed array as well. I will
be needing that too later.
I'll try implementing your suggestions.

Thank you,
Amit


On Jun 25, 4:40 pm, altenbach <x...@no.email> wrote:
> Yes!
> &nbsp;
> If you want a flat probability distribution 0..1, use the "dice" from the numeric palette. Now simply place it inside two stacked FOR loops and wire the two N with the desired number of rows and columns. You'll get a 2D array of the desired size due to the autoindexing feature of the output tunnels. Try it!
> &nbsp;
> For e.g. a normal distributed 2D array, &nbsp;you could use the gaussian white noise from the singal generation palette. Simply create a 1D array with a size corresponding to the produce of the desired number of columns and rows, then reshape it to a 2D array.
> &nbsp;
> There are many other ways to do this. Can you tell us a bit more about your appliaction?
> &nbsp;
> (Of course you haven't really told us what you mean by a "random 2D array ". a 2D array of fixed size containing random numbers? A 2D array of random size?Message Edited by altenbach on 06-25-2007 04:23 PM




0 Kudos
Message 3 of 3
(3,142 Views)