LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Native Histogram VI seems to have error

Solved!
Go to solution

Dear all,

 

I've been working on something where I need histograms but it seems to me that there is something wrong with the LabVIEW native VIs.

 

As an attachment, I send you an example I made to support what I'm saying.

 

I want the histogram to have 1000 bins with the minimum boundary equal to 0 and the maximum boundary equal to 1. The histogram is built from 500 random values.

 

The problem is that I cannot make the histogram to have the bins limited between 0 and 1, including 0 and 1.

 

Maybe I'm just interpreting something wrong but it would be interesting to have your feedback.

 

Thank you very much in advance!

 

Best regards!

0 Kudos
Message 1 of 3
(2,357 Views)
Solution
Accepted by topic author Goju-Ryu

You should read the "detailed help" for the histogram function. The X values are the centers of the bins. For 1000 equally-spaced bins over the range of 0 to 1, the first bin goes from 0 to 0.001 (center 0.0005) and the last from 0.999 to 1 (center 0.9995). The histogram function is doing exactly what it is documented to do.

 

If you want your bins numbered from 0 to 1 inclusive, you need 1001 of them, over a range of -0.0005 to 1.0005.

 

Cameron

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
Message 2 of 3
(2,351 Views)

Dear camerond,

 

thank you very much for your clarification.

 

Best regards!

Message 3 of 3
(2,336 Views)