speeding up the data analysis
10 views (last 30 days)
Show older comments
I am working on a project where I have to analyse high frequency wind data (50 Hz) coming from a wind turbine data measurement system. this amount of data must be converted from .dat binary files to .mat files which I can use in matlab. The data must then be filtered and then averaged over 10 minutes to be compared to the data from another measurement system. Doing all this requires the analysis of thousands of data and it's very time consuming (right now it is about 105 seconds just for the data of 2 days). How can I speed the process up?
for ii = 3:length(filedir)
filename = filedir(ii).name;
newdata = ReadFamosDataIntoTimeTable(filename);
% filter
IsConsidered = newdata.avbladeangleGRe<40 ... % normal operation
& newdata.RAWS9>0.5 ... % good availability
& ~isnan(newdata.iv10mswindspeed2GRe) & newdata.av100msabswinddirectionGRe>180 & newdata.av100msabswinddirectionGRe<250;
TurbineData(ii-2).date = filename;
TurbineData(ii-2).iv10mswindspeed2GRe = mean(newdata.iv10mswindspeed2GRe(IsConsidered));
TurbineData(ii-2).ivactivepowerGRe = mean(newdata.ivactivepowerGRe(IsConsidered));
TurbineData(ii-2).CalculatedAirdensity_GRe = mean(newdata.CalculatedAirdensity_GRe(IsConsidered));
TurbineData(ii-2).HWShub1 = mean(newdata.HWShub1(IsConsidered));
TurbineData(ii-2).av100msabswinddirectionGRe = mean(newdata.av100msabswinddirectionGRe(IsConsidered));
end
The function ReadFamosDataIntoTimeTable is to convert the .dat binary data into .mat data
0 Comments
Accepted Answer
Steven Lord
on 28 Jul 2025
Does the Code Analyzer app or the code analyzer information included in the Editor when you edit these files make any recommendations that suggest improved performance?
I suspect that ReadFamosDataIntoTimeTable is the bottleneck (simply because it's doing file I/O) but you haven't showed us the code of that function so we can't offer any specific suggestions about it.
One potential (likely small) optimization would be to index into the timetable array once using IsConsidered rather than indexing into each variable separately. Compute something like:
newdataFiltered = newdata(IsConsidered, :);
TurbineData(ii-2).iv10mswindspeed2GRe = mean(newdataFiltered.iv10mswindspeed2GRe);
TurbineData(ii-2).ivactivepowerGRe = mean(newdataFiltered.ivactivepowerGRe);
% etc
More Answers (0)
See Also
Categories
Find more on Tables 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!