Multiplication of matrix element of different size matrix

조회 수: 1 (최근 30일)
Aryama Mandal
Aryama Mandal 2015년 6월 4일
편집: James Tursa 2015년 6월 4일
I want to perform this
m(l,j)= sum of (i=1 to M)(x(i,l)*w(i,j))/ sum(i=1 to M)x(i,l)
where ,x will get from this code
v=[1 0;0 1;1 0]
rowperms = perms(1:size(v, 1));
x= cellfun(@(rowperm) v(rowperm, :), num2cell(rowperms, 2), 'UniformOutput', false);
w is 3*5 matrix. How to perform it? what I have done is
for l1=1:ll
for j1=1:jj
summ1=0.0;
sumx1=0.0;
for i1=1:ii
m1(l1,j1)= (x(i1,l1))*(w(i1,j1))%total load of cell l induced by part j(for a fixed value of l and j and differerent value of i multiplying x and w)
summ1=summ1+m1(l1,j1)
x1(i1,l1)= x(i1,l1)% no of machine in cell l
sumx1=sumx1+x1(i1,l1)
end
m(l1,j1)=summ1/sumx1% avarege cell load
end
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Genetic Algorithm에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by