[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Sum of matrices
From: |
Ben Abbott |
Subject: |
Re: Sum of matrices |
Date: |
Sun, 15 Sep 2013 21:32:15 -0400 |
On Sep 15, 2013, at 6:04 PM, george brida wrote:
> Dear Octavers,
> Suppose we have 100 square matrices of order 50: A_1; A_2;...;A_100. We put
> these matrices in the following manner: B=[A_1;A_2;...;A_50]
> how we can write a program performing the sum of these matrices from the
> matrix B.
> Thank you
I'm not sure I understand the structure of B. If the size of B is [(50*50) x
50] then ...
sum (reshape (B', [50, 50, 50]), 3)
If the size of B is [(100*50) x 50] then ...
sum (reshape (B', [50, 50,100]), 3)
Ben