Clear Filters
Clear Filters

Why will findpeaks not work when filtering is applied?

1 view (last 30 days)
Good evening everyone,
I have been running a flume experiements within a uniform water level sequence over a period of time, due to the constraints on the equipment the implimentation of the appplies series haves to be done in small increments i.e. water level change every 4 seconds instead of 1. My problem is that this has created very small local maxima, which has interferred with the overall global. What I have managed to do is extract the majority peak pore pressures and the time this occurs using the findpeak levels (crest of the slope) to a cell array, however the local maxima have also been detected and extracted. So, to eliminate this I applied the filter (1-D digital) to the matrix and comparing the graphs of before and after, it appears that the data has been sufficently smoothened to remove the majority of the ammolous results. However, when I run the same code to extract the data it says:
"Unable to perform assignment because brace indexing is not supported for variables of this type."
I just simply do not understand why as as far as I can tell nothing has changed, but it clearly has.Attached is example data, time first column, sensors the remaining.
Could you please help?
A=Example; % Data unfiltered -Works
[~, y]=size(A);
for i=1:y
[a{i},m{i}]=findpeaks(A(:,i));
data{i}(:,1) = flume_a(m{i});
data{i}(:,2) = a{i}(:);1
end
%% This section applied filter - Doesn't work
windowSize = 6;
b = (1/windowSize)*ones(1,windowSize);
a = 1;
C= Example;
[~, y]=size(C);
A = filter(b,a,C);
for i=1:y
[a{i},m{i}]=findpeaks(A(:,i));
data{i}(:,1) = flume_a(m{i});
data{i}(:,2) = a{i}(:);1;
end

Answers (0)

Community Treasure Hunt

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

Start Hunting!