필터 지우기
필터 지우기

Trying to extract data between two event time points

조회 수: 2 (최근 30일)
Austin Bollinger
Austin Bollinger 2021년 12월 16일
편집: Austin Bollinger 2021년 12월 16일
I am trying to extract some data and do a correlation of the data between two event points on a graph. I found the timing of the event markers and was trying to put that into a for loop to extract data between the two time points. Ran into a lot of issues and started over, do not know where to go from there. Any istance or guidance would be appreciated!
jevent=dSpare_data(:,18); % joystick trigger to bbe used to make start/end of perception segments
jroll=dSpare_data(:,19)*-19; % joystick roll, scale +/- 1 for full scale deflection
jpitch=dSpare_data(:,20)*-19; % joystick pitch, scale +/- 1 for full scale deflection
jyaw=dSpare_data(:,21); % joystick yaw, scale +/- 1 for full scale deflection
t = ckas_timestamp-ckas_timestamp(1)+0.1; % time in sec
ckas_pitch=ckas_xyzypr(:,5);
ckas_roll=ckas_xyzypr(:,6);
figure;
plot(t,jroll,t,jpitch,t,jyaw,t,jevent,t,ckas_pitch,t,ckas_roll);
xlabel('Time (in seconds)');
title('Signal vs Time');
legend({'jroll','jpitch','jyaw','jevent','ckas pitch','ckas roll'},'Location','best');
zoom xon;
grid on;
EventM = [t,jevent];
EventTime = EventM(EventM(:,2)==-4, 1);
ET = round(EventTime);
ETF = unique(ET);
CorrData = [t,ckas_pitch,ckas_roll,jpitch,jroll];
for i = 1:length(ETF)-1
ind_start = ETF(i,1);
ind_stop = ETF(i+1,1);
end
PitchCorrelation = corrcoef(jpitch,ckas_pitch);
RollCorrelation = corrcoef(jroll,ckas_roll);
display(PitchCorrelation);
display(RollCorrelation);

답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by