MATLAB: How to calculate multiple array at once

meanvoltage

Hi Guys! I'm trying to do a MeanVoltage = mean(B0006.cycle(1:20).data.Voltage_measured) to store 1×20 data of mean voltage from B0006.cycle(1).data.Voltage_measured to B0006.cycle(20).data.Voltage_measured. Any recommendation? Thank you in advance!
PS: I got 1200+ data in the actual file, too much work to do it line by line.

Best Answer

load NEEDHELP
n = numel(TEST);
meanVolt = zeros(1,n);
for j = 1:n
meanVolt(j) = mean(TEST(j).data.Voltage_measured(1:20));
end
Related Question