# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## statistics express vi with an array as input

I am trying to obtain the statistics of an array of elements, with the statistics express vi. I used the build waveform, in order to connect the array as input to the express vi, but this only uses the last value of the array instead of the sum of all the values of the array.

I am using simple data to make the calculation, so that I know the value before hand.

I use the values 2 and 4 and I am trying to obtain the mean, but I get a wrong value.

Message 1 of 19
(3,640 Views)

## Re: statistics express vi with an array as input

Use Convert to Dynamic Data Type, not Build waveform.

Message 2 of 19
(3,631 Views)

## Re: statistics express vi with an array as input

If I put an array of 2 and 4 into your Express VI, I get a Mean of 3 (correct) and a Std Dev of 1.414 (also correct).  If you are getting some other value, you are doing something very wrong.  Why not try to write the World's Simplest VI, consisting of an Array being initialized to 2 and 4 and your Express VI?  You should get 3 and 1.414 ...

Bob Schor

Message 3 of 19
(3,617 Views)

Message 4 of 19
(3,584 Views)

## Re: statistics express vi with an array as input

I am still getting wrong values

As others pointed out, try first understanding how the Statiscs express.vi takes input and calculates and gives output.

-Try giving simple data as array of 3-4 numbers and try the vi and see how the values are generating for stats.

-What is your input data? There's lot of data in excel, which is your input exactly?

-What is the output values it should be?

-What stats you are looking exactly?

Check the example also provided in the help for Static Express.vi

Thanks
uday
Message 5 of 19
(3,574 Views)

## Re: statistics express vi with an array as input

It gives me the right values right now, the thing is that I need to convert those values to string, so I can display them in a table, but I can't convert them to string.

Can you please tell me how to do so, since I tried with all the number to string converters and couldn't make the conversion.

Message 6 of 19
(3,571 Views)

## Re: statistics express vi with an array as input

@Nando88 wrote:

I run your VI and get this.  What do you expect the results to be?

One thing I notice is that your data has a header row.  Are you accouting for that that?  You are running your For Loop the same number of times as you have rows.

Message 7 of 19
(3,565 Views)

## Re: statistics express vi with an array as input

I took that into consideration. I just need to be able to convert the values given by the express vi into strings.
Message 8 of 19
(3,561 Views)

## Re: statistics express vi with an array as input

I believe you definitely need to learn about LabVIEW. Please try below free online material :

NI Learning Center

NI Getting Started

3 Hour LabVIEW Introduction

6 Hour LabVIEW Introduction

LabVIEW Graphical Programming Course

@Nando88 wrote:

It gives me the right values right now, the thing is that I need to convert those values to string, so I can display them in a table, but I can't convert them to string.

Can you please tell me how to do so, since I tried with all the number to string converters and couldn't make the conversion.

-Care to explain how suddenly they're giving right values?

-What you tried to convert to string?

-Which values are you trying to do conversion?

-What is the data type of values?

-Which functions you tried and not able to make the conversion?

Thanks
uday
Message 9 of 19
(3,557 Views)

## Re: statistics express vi with an array as input

Look at the string palette and the function "Format into String".

Message 10 of 19
(3,556 Views)