Plotting arrays of same length

조회 수: 1 (최근 30일)
Lucrezia Mattia
Lucrezia Mattia 2022년 5월 26일
답변: Torsten 2022년 5월 26일
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)=[];

답변 (1개)

Torsten
Torsten 2022년 5월 26일
y_picchi = interp1(time,y,tempo_picchi);
plot(tempo_picchi,y_picchi)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by