Thread Subject: Getting mean, std, var and cov value of cell array

Subject: Getting mean, std, var and cov value of cell array

From: Tirta Dhany

Date: 24 Nov, 2009 10:49:03

Message: 1 of 2

Hello, People
I just learn MATLAB and newbie. I have cell array like this
Name Size Bytes Class Attributes

  Yh 3x1 2064564 cell

<128x128x6 double>
<64x64x6 double>
<32x32x6 double>

I'm confusing in dimension and how to use this data to get values of mean, std and cov of Yh.
So, how to get this values?
Really appreciate for your help.
Thanks.

Subject: Getting mean, std, var and cov value of cell array

From: Wayne King

Date: 24 Nov, 2009 11:47:03

Message: 2 of 2

"Tirta Dhany" <dhany19@gmail.com> wrote in message <hegdmv$heg$1@fred.mathworks.com>...
> Hello, People
> I just learn MATLAB and newbie. I have cell array like this
> Name Size Bytes Class Attributes
>
> Yh 3x1 2064564 cell
>
> <128x128x6 double>
> <64x64x6 double>
> <32x32x6 double>
>
> I'm confusing in dimension and how to use this data to get values of mean, std and cov of Yh.
> So, how to get this values?
> Really appreciate for your help.
> Thanks.

Hi Tirta, use cellfun(). See

>>doc cellfun

for example:

% Create a cell array with some data
Y = cell(2,1);
Y{1,1} = randn(10,10);
Y{2,1} = randn(10,1);
% Apply cellfun() to get mean and std
Meanz = cellfun(@mean,Y,'UniformOutput',false);
Stdz = cellfun(@std,Y,'UniformOutput',false);

Hope that helps,
Wayne

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
value Tirta Dhany 24 Nov, 2009 05:54:05
mean Tirta Dhany 24 Nov, 2009 05:54:05
cov Tirta Dhany 24 Nov, 2009 05:54:05
std Tirta Dhany 24 Nov, 2009 05:54:05
cell array Tirta Dhany 24 Nov, 2009 05:54:04
rssFeed for this Thread

Contact us at files@mathworks.com