07-17-2017 06:59 AM
Hi all,
I have two questions. The first is about calculating the Mean.
I have an array with normal values and NaN values in between. I need to calculate the mean from every couple of measurements (user input). But, my program also takes the NaN values with it, so the more points I want to calculate the mean of, the more data disappears. Now, what I want is this: I want the mean value of all the numeric data, without the NaN's, but I still need the NaN's to be in the array. I've removed the NaN's and then I was able to calculate the mean, but after that, the NaN's have to go back in the array on the place where they first were. I wrote the program as seen in the file, but it doesn't place the NaN's back where they were.
This is a rather long question, I will start a new message for my other question.
Thanks a lot in advance.
Solved! Go to Solution.
07-17-2017 07:30 AM
07-18-2017 03:29 AM
Hi,
Thanks for the reply! Didn't know about the existence of the 'Not a number/path/refnum?' boolean. This already helped me a lot. Now I'm not quiet there yet. I want the sample length to be a control. The data will end up in a graph, and since the whole bunch is in a while loop, the user should be able to live edit the graph. This works for the sample lengths 1 (made a case structure for that) and two, but after two the graph doesn't change any more. I've attached my program. I hope you can help me further with this.
Thanks in advance,
LvL
07-18-2017 03:35 AM
Hi lvl,
I've attached my program. I hope you can help me further with this.
NO, you didn't attach a "program" - all you attached is an image!
If you would attach a real program (aka VI) with some default data embedded I surely will help!
Hint: Those PtByPt function also has an "init" input. And I guess you need to use that for each new calculation…
07-18-2017 03:44 AM
Here it is
I also attached the file I use to read the data from.
07-18-2017 03:52 AM
07-18-2017 04:08 AM
Thank you so much!! Have a great day 😄