disjoint of matrix in Matlab?how to do ?
Show older comments
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
Lalit Patil
on 7 Dec 2012
%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
Vishal Rane
on 7 Dec 2012
@Lalit : For identical size matrices simply use
x = x1+x2+x3
Lalit Patil
on 7 Dec 2012
Oh yes, i tried it.. Thanks..
Answers (0)
Categories
Find more on Map Display in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!