Multiplication of matrix element of different size matrix

1 次查看(过去 30 天)
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