Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

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

1 Ansicht (letzte 30 Tage)
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.

Antworten (0)

Diese Frage ist geschlossen.

Produkte


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by