Info
此问题已关闭。 请重新打开它进行编辑或回答。
error in performing summation
2 次查看(过去 30 天)
显示 更早的评论
I have an equation
summation i= 1 to n,Q^2ir/(Mi+M+r)
where
n=99
S=2
qir is the number of samples with class i (i = 1,2,. . . ,S, and r = 1,2,. . . ,n) in the interval (dr-1,d),Mi+ is the total number of samples with class i, and M+r is the total number of samples in the interval (dr-1,d)
Mi+=60
wen i calculate i get only one value,but the outout must be of many values..please help
回答(1 个)
Daniel Shub
2012-1-9
I am guessing that if x is your answer that you want to have many values that you are doing something like
x = calc(a,b,c,i)
instead of
x(i) = calc(a,b,c,i)
also don't forget to preallocate x.
EDIT based on your comment to the question:
Z(i,r) = ceil( ...
you also probably want to add:
Z = zeros(2, 99);
before the loops.
1 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!