From the course: Learning LabVIEW

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution: Moving average

Solution: Moving average - LabVIEW Tutorial

From the course: Learning LabVIEW

Start my 1-month free trial

Solution: Moving average

(upbeat music) - [Instructor] Here's how I solved the challenge to implement a moving average. I'll need to access the randomly generated values from previous loop iterations. So, I'll create a shift register by right-clicking on the while loop and selecting Add Shift Register. And I'll go ahead and wire the current value into it. Now, I don't just need the previous value, I need the previous four values. I could right-click on the shift register and choose to Add Element and do that three times, or, as a shortcut, I can simply hold the Control key and then drag down on the shift register, and that allows me to add more elements. When you need to add a bunch of shift registers, that's usually a little bit quicker. Next, I'll press Control + Space to bring up the Quick Drop menu, search for Compound Arithmetic, and place that. I'll move the moving average over a little bit, and the compound arithmetic by default has…

Contents