LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Waveform graph random integers

This is part of the problem I'm doing, I'm suppose to produce 20 random integers between 0 and 100 and have them on the waveform graph. The way I have it setup I think is that it is running from 0 to 19 times and that it connect to the graph. Is this correct?

0 Kudos
Message 1 of 10
(4,353 Views)

If Iwas going to critique your setup, I would say you did not accomplish it. First, you did not plot 20 integers between 0 and 100. You plotted 19 floating point numbers.

0 Kudos
Message 2 of 10
(4,351 Views)

Loo is right, if you want integers you should use one of the "Round to ___" vis that are on the Numeric Palette.

Also you should wire 20 to your N input, then it will run 20 times (from 0 to 19).  The way you have it will only run 0 to 18 (19 total numbers).

0 Kudos
Message 3 of 10
(4,347 Views)

alright got it, umm am i still plotting floating numbers still =/

 

Should I initalize an array from 0 to 20 for it to work the way i want?

 

 

0 Kudos
Message 4 of 10
(4,339 Views)

Instead of a ceiling function I would just convert it to integer. The way you have it setup, 0 is highly unlikely to ever be selected in your list.

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

like this?

 

also am I still plotting 20 floating numbers?

0 Kudos
Message 6 of 10
(4,330 Views)

That is much better.

 

I looked through the previous post. You never mentioned what kind of random numbers you want. What you have there is a uniform distribution. Do you want guassian, normal, exponential? If so, you will need to do more research on random number generation.

0 Kudos
Message 7 of 10
(4,327 Views)

well random numbers integers just between 0 and 100 and I want to plot the 20 random numbers on the wave form graph 😃

0 Kudos
Message 8 of 10
(4,322 Views)

is the setup correct or do i have to add something else?

0 Kudos
Message 9 of 10
(4,315 Views)

There are different type of random numbers. What you currently have is a uniform distribution. There ar normal, exponential, etc. types of random numbers. That is the question you should be researching now. You have the basics. Your next step is to determine the rest of the information.

0 Kudos
Message 10 of 10
(4,277 Views)