I have a loop calculating the variance, which I want to plot.
for k = [1:3]
disp(B.colheaders{1, k});
%disp(B.data(1:79, k + 1));
for j = [1:10:79]
disp(j)
Variance = var(B.data(j:j+8, k))
end
%disp(V)
plot(Variance)
end
How do I store the variances to an array or matrix so I can plot them all?
Here’s a way if you want to keep the loop:
Here’s a way where you skip the inner loop