Smoothing Data
Материал из Поле цифровой дидактики
Версия от 03:04, 24 июня 2021; scratch>TheTrillion (Making those two separate sentences would sound better.)
Шаблон:Stub Шаблон:Wiki Standards Smoothing data is a common way to make graphs and data look neat when visualized. In this tutorial a moving average is demonstrated.
Script
Here is the script:
define Smooth List // Run without screen refresh delete all of [Smoothed v] // Reset the smoothed list set [i v] to (1) // set the counter to 1, start smoothing at the first item of the list repeat (length of [data v]) // iterate through the list set [i2 v] to (1) // set the second counter to 1 repeat (smoothing) set [smoothed v] to ((smoothed)+(item ((i)+(i2)) of [data v])) // average the items on the list to get the smoothed item change [i2 v] by (1) end set [smoothed v] to ((smoothed)/(smoothing)) add (smoothed) to [Smoothed v] // add finished smoothed item to another list change [i v] by (1) // smooth next item end