08-27-2009 06:45 AM
Hi all. I would like to average 2D arrays whilst running the measurement. I attachhed the VI below, in which i receive data from 2 instruments and plotting them into a XY graph with history. What i want to do is averaging graphs every 200th sampling and plot it.
to make it clear:
i start the measurement and collect 200 x and y datas lets call sample 1
as running the loop another 200 x and y datas (201th-401th datas) called sample2
and average them ((1th+201th)/2, (2th+ 202th)/2,... and plotting.
when i get the another 200 x,y datas ( 402th-602th datas) called sample 3, i want to average
those with previous ones ( 1th+201th+402th)/3, (2th+202th+403th)/3
and keep doing this process till i stop the measurment.
I am a bit confused how to start with algohrithm. any hellp is appreciated
thanks
08-27-2009 07:25 AM
Slow down!
First of all, lets assume you specify a resource (which you aren't), are you getting the data you want in the atttached VI by reading the VISA resource as opposed to the reading the read buffer????
08-27-2009 07:32 AM
08-27-2009 07:37 AM
08-27-2009 07:38 AM
08-27-2009 07:39 AM
08-28-2009 08:49 AM
The missing resource was one thing. I was more surprised at the fact that you wired the resource into the string>number function, so your data IS the resource. Interesting.
Anyway, sorry if it seems I hijacked your thread with an urelated question.
Attached is a VI (saved to 8.5) that will hopefully give you some ideas on how to build the three samples of 200. I didn't quite understand your averaging, so I guessed at it.