How to write a matlab code to perform moving compuation for any equation?

2 Ansichten (letzte 30 Tage)
Lets say I have a vector of 1000 random numbers and want to sum every 30 numbers of the vector and store it in a variable.

Akzeptierte Antwort

Sulaymon Eshkabilov
Sulaymon Eshkabilov am 8 Jan. 2023
Bearbeitet: Sulaymon Eshkabilov am 8 Jan. 2023
There are a couple of ways to do it, e.g.:
V = randi([-10, 100], 1, 1000);
n = 1:30:numel(V);
for ii=1:numel(n)-1
ans = 33

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by