I have a system build in simulink and the output of the system. The output has valuable data points in the peaks/spikes and other, not valuable data points at magnitude of 70.
What I am struggling to achieve is the output signal, consisting only of the valuable data points connected with each other straightforward(basically, these are the datapoints I need).
I attached the picture with the original output signal from the scope and the one I built from it in matlab after extracting the original as a structure with time into workspace.
After processing the signal from the scope in matlab
Here is the code I use to process and plot it:
ab = [];
a = [];
for i=1:numel(Tc.signals.values)
if Tc.signals.values(i)<70
ab = [ab;Tc.signals.values(i)];
a = [a;Tc.time(i)];
end
end
plot(a, ab, '-k', 'LineWidth', 1);
grid on;
My question is what blocks and how should I add so that the output is transformed during the simulation into what I ploted outside the simulation from matlab? I really have difficulties finding a good solution... :(
Thank you very much in advance!