Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Sum of cell array
Replies: 1   Last Post: Aug 2, 2012 9:32 AM

 Messages: [ Previous | Next ]
 Antonio Valentine Posts: 17 Registered: 7/29/12
Sum of cell array
Posted: Aug 2, 2012 2:44 AM

Hello I have less experince in using the cell array before. I need some help.

Here it goes,

I have a cell array "D" like this.
{29x10 cell} {40x10 cell}
{37x10 cell} []

Each element
>> D{1,1}{1:10,10} % go for 10 arrays.
ans =
0 0 0
ans =
0 0 0
ans =
0 0 0
ans =
0 0 0
ans =
0 3 0
ans =
0 0 0
ans =
0 7 0
ans =
0 0 0
ans =
0 0 0
ans =
6 6 6

I want to keep the results to only 1 variable e.g., D_temp{1,1}{1,1} = [6 16 6].

Basically, I want to have a summation along the dimension "c" -- {a,b}{c,d}.

What are the function should I use including all the statiscal functions too.

Thank you in your kindly help

Date Subject Author
8/2/12 Antonio Valentine
8/2/12 Bruno Luong