Info

This question is closed. Reopen it to edit or answer.

Matrix element operation with a loop for long time series

1 view (last 30 days)
I have a cell of 240 x 1 cell, where in each cell i have stored a matrix of 99 x 133 dimension. I want to have a loop where I can go to each cell and get the standard daviation of each each individual matrix element in the 240 time series. How can I make a loop for such situation?
  1 Comment
Satyajeet Sasmal
Satyajeet Sasmal on 19 Aug 2015
Hi Gazi,
You do not need a for loop to do standard deviation in a cell array. Please look at the example below for a way to achieve this:
C{1}=rand(99,133);
C{2}=rand(99,133);
C{3}=rand(99,133);
cellfun(@(x) std(x(:)),C);
ans: 0.288837575204058 0.288725140946325 0.288349523455399
For more information on "cellfun" please see the documentation below:

Answers (0)

Community Treasure Hunt

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

Start Hunting!