Plotting arrays of same length

Hello to Everyone! I have a little problem:
I wanto to plot a graph of which the vector of time has been modified from the Original Signal, and i want to plot it on the Original Signal. The vector of time that is modified is tempo_picchi (1x134), and the original signal has these dimensions : time(1x4050),y(1x4050); I want to annote the y(orginial signal) in tempo_picchi;
Thank you!
The Code is this :
soglia = find(y(locs_zero)>= 0.03);
locs_zero_1 = locs_zero([soglia, soglia-1]);
tempi_1 = tempo(locs_zero_1);
tempo_picchi = tempi_1(:,1);
tempo_onset = tempi_1(:,2);
delta_tempo = 0.3;
index_picchi = find(diff(tempo_picchi)<delta_tempo);
index_onset = find(diff(tempo_onset)<delta_tempo);
tempo_picchi(index_picchi)= []; I cancel the values in this position.
tempo_onset(index_onset)=[];

Réponses (1)

Torsten
Torsten le 26 Mai 2022

0 votes

y_picchi = interp1(time,y,tempo_picchi);
plot(tempo_picchi,y_picchi)

Catégories

En savoir plus sur Line Plots dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by