LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to build a 3d array and fill it with random numbers between 1 and 10.

Im not sure where to start on this problem. Here is the assignment. Any help would be greatly appreciated. 

0 Kudos
Message 1 of 10
(5,164 Views)

This tutorial is a good place to start.

 

[edit]

Read it, try out a few things, then post the VI you made here.  Don't be afraid, we don't bite very hard.

[/edit]

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 2 of 10
(5,160 Views)

At least you had the honesty to admit that this is homework.  Typically we will not do your homework for you (we don't get the grade) but we will help with the basics.

 

Arrays and clusters should not be causing you problems.  If they are hit Ctrl+H and start looking at the help file.  There is a lot of good information there.  For loops are on the structures palatte you will need three nested for loops.  The Random function is on the numeric palatte Array max and min is on the array palatte.

 

Let us know how it comes together.


"Should be" isn't "Is" -Jay
Message 3 of 10
(5,157 Views)

do a search on " random + between" and "3d array"  Smiley Wink

0 Kudos
Message 4 of 10
(5,129 Views)

Also make sure you read the question correctly.

 

We are looking for random numbers between 0 and 10, not between 1 and 10 as your post title might suggest. This actually makes the problem simpler. 😉

0 Kudos
Message 5 of 10
(5,122 Views)

I made a blog post on true random generation in labview.

 

That shouldn't be the hard part 😛 figuring out how to insert it into a 3d array should be.

 

https://decibel.ni.com/content/docs/DOC-31601

0 Kudos
Message 6 of 10
(5,099 Views)

@Valarauca wrote:

I made a blog post on true random generation in labview.

 

That shouldn't be the hard part 😛 figuring out how to insert it into a 3d array should be.

 

https://decibel.ni.com/content/docs/DOC-31601


There are several problems with that VI. You should not use I64, because the random number is DBL and thus has significantly less mantissa bits and you'll get missing integers if the range is large.

 

The typical way to get equal probability is to round down, e.g. as follows.

 

 

 

 

Message 7 of 10
(5,079 Views)

Here is what i have so far. I have searched the array funcions but I cant think up how im going to input the random numbers into the array. As said before this is the hard part. 

0 Kudos
Message 8 of 10
(5,006 Views)

Instead of 1 For Loop creating all the numbers, think of Nested For Loops.

 

You have the concept of Auto-indexing established where a scalar creates a 1-D array at the output tunnel of a For Loop..  Think of what happens when you auto-index the output of a 1-D array, then 2-D array.

Message 9 of 10
(5,001 Views)

Nested loops were previously mentioned  Or, check into "Reshape Array"  Keep that help on while you look through the pallates


"Should be" isn't "Is" -Jay
0 Kudos
Message 10 of 10
(4,975 Views)