disjoint of matrix in Matlab?how to do ?

Dear all, i have X= x1+ x2+ x3 all are 5 by 6 size matrix. now this X is split into two disjoint group . The matrices within each group are added. how to do this in matlab?please explain with some example.

3 Comments

%Example :
x1 = [1 2 3;4 5 6];
x2 = [1 2 3;4 5 6];
x3 = [1 2 3;4 5 6];
[m n] = size(x1);
for i = 1:m
for j = 1:n
x(i,j) = x1(i,j) + x2(i,j) + x3(i,j) ;
end
end
@Lalit : For identical size matrices simply use
x = x1+x2+x3
Oh yes, i tried it.. Thanks..

Sign in to comment.

Answers (0)

Asked:

on 7 Dec 2012

Community Treasure Hunt

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

Start Hunting!