How to take 4 variables and do a calculation on them then update to a constant stream of data

1 vue (au cours des 30 derniers jours)
I have a constant stream of data coming into my program from an arduino. I want to graph the data but I need to create an acceptable variance in order to do that. I have created a user input to tell me their acceptable variance and then I'm stuck on what to do. My psuedocode for what I want to do is this:
% take 4 values of data and sort them into an array
% calculate the standard deviation of those 4 values
% if standard deviation < acceptable variance
% plot
% else
%
% end
I guess my question is, how do I take 4 values from my constant stream of data, do the calculation, plot that, then update the 4 values again...?
Thanks in advance

Réponses (0)

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by