Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



std for growing columns of a matrix
Posted:
Apr 25, 2014 2:51 PM


Hello :),
i am looking for an effective way to calculate following problem:
for i=1:1000 tmp=data(1:i,:); rsStd(i)=std(tmp(:)); end
"data" is a matrix with k rows and j columns. What i dont want is to calculate the std for every column. What i would need is the std for a growing data range. By each loop step the data range for the calculation of the std grows as you can see in the code snippet.
Does anyone know probably a faster solution and could give me a hint? I am thinking something with vectorization but currently i have no idea. Many thanks!



