how i implement this equation.
Show older comments
hey guys,
i am try to implement to loop of follow equation
where Eci is the energy charge by the ith sensor.

Accepted Answer
More Answers (1)
This depends on the format of Ec... is it a matrix or cell array?
Assuming Ec is a matrix with "i" rows and "e" columns...
Ec = zeros(c,1);
for i = 1:c
Ec(i) = sum(Ec_ie(i,:));
end
or in a single line:
Ec = sum(Ec_ie,2);
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!