How can I save the values obtain from a for loop in a nx1 vector?
Show older comments
x=0:996;
for x=x+4
t=datarng(x-3:x,1);
avg=sum(t)/4;
"datarng" is a variable which the data I am analyzing is being saved to. What I am doing is taking the average of every for numbers and my goal is construct a new matrix (vector) which has all the average values calculated in it. Any help is appreciated! Thanks!
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!