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 - LabVIEW Tutorial
From the course: Learning LabVIEW
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
While loops3m 42s
-
(Locked)
For loops3m 6s
-
(Locked)
Build an array with a for loop2m 11s
-
(Locked)
Process an array with a for loop2m 22s
-
(Locked)
Loop timing2m 54s
-
(Locked)
Local variables6m 18s
-
(Locked)
Shift registers2m 26s
-
(Locked)
Stacked shift registers2m 24s
-
(Locked)
Challenge: Moving average52s
-
(Locked)
Solution: Moving average2m 25s
-
-
-
-
-
-