matrix operation
1 次查看(过去 30 天)
显示 更早的评论
I have an matrix
A=[1 0 0 0 0 0 1;0 1 1 0 1 1 0 ;0 0 0 1 0 0 0 ] want to perform matrix operation using the formula
(summation i=1 to s summation r=1 to 7 q^2ir/Mi*Mr)-1/log(n)
s=3
Mi for ist row is 2,second row is 4,third row is 1
Mr is 1 for all cases
n=7
0 个评论
采纳的回答
Andrei Bobrov
2012-1-11
[m k] = size(A);
i1 = (1:m)';
r = 1:k;
Mi = [2; 4; 1];
Mr = 1;
out1 = bsxfun(@rdivide,i1*r.*q.^2,Mi)*Mr;
out = sum(out1(:)) - 1/log(n);
ADD
out2 = max(out1) - 1/log(n);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!