Info

此问题已关闭。 请重新打开它进行编辑或回答。

Unable to perform assignment since the left & right sides have a different number of elements.

1 次查看(过去 30 天)
Why am I getting the error above assigning a scalar to an array element? We do that regularly in programming languages.
is it something that I have missed?
Further, this problem occurs because the size of the sum array is 300X300.
Just tell me how do I get the size of this array to 1X300 & then we'll all be done.
I'm doing this in my code:
for i=1:1:n
if(S(i).E>0)
sum=sum+S(i).E;
end
end
avg=sum/n-Eo;
average(r1)=avg;
please note that this is the inner part of an enourmous r1 outerloop. the maximum value of r1(number of rounds) is 300. The number of sensor nodes that I'm using is 300. I can post my codeif needed.

回答(0 个)

此问题已关闭。

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by