I want to find the average of n data points in an array and cycle through to create a new array.

1 次查看(过去 30 天)
I'm a complete beginner so sorry I can't even attempt this myself, go easy on me, please. Thank you :)

采纳的回答

Bjorn Gustavsson
Bjorn Gustavsson 2017-11-8
Depending on your future likelihood of using different levels of matlab read up on howtos and introductions to use matlab.
That said...
Read/load as much data as you can into memory at once and then process the data as suitable. Splitting up reading in steps and chunks is just going to bog down the writing running and updating your code.
If your ecg-data can be loaded with matlab's load function use that. If you can use use some of matlab's functions for loading data from formatted text-files, like textread, then use those. If you need to read files in some more obscure format you might have to use fscanf or for data in binary formats fread or fgetl/|fgets|. In the best case you have some code read the ecg-files if they are in some dedicated file-format, then this step is set.
For the filtering you can use either the filter function or the conv function:
ecg_sliding5 = conv(ecg_data,ones(1,5)/5,'same');
HTH

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matched Filter and Ambiguity Function 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by