to convert .events to .mat

1 Ansicht (letzte 30 Tage)
Ajay Kumar
Ajay Kumar am 12 Jul. 2023
Beantwortet: Ajay Kumar am 13 Jul. 2023
Hi everyone,
I have openephys recorded files including .continuous and .events.
i am trying to convert .event to .mat using this code.
file_path = 'C:\Users\Documents\Data;
event_data = loadOpenEphysEvents(file_path);
% Extract start and end times
event_start_times = event_data(:, 1);
event_end_times = event_data(:, 2);
for i = 1:length(event_start_times)
disp(['Event ', num2str(i), ': Start Time - ', num2str(event_start_times(i)), ', End Time - ', num2str(event_end_times(i))]);
end
after running this code i am getting this output
Event 1: Start Time - 0, End Time - 0
Event 2: Start Time - 0, End Time - 0
Event 3: Start Time - 0, End Time - 0
Event 4: Start Time - 0, End Time - 0
Event 5: Start Time - 0, End Time - 0
Event 6: Start Time - 0, End Time - 0
Event 7: Start Time - 0, End Time - 0
Event 8: Start Time - 0, End Time - 0
Event 9: Start Time - 0, End Time - 0
Event 10: Start Time - NaN, End Time - NaN
Event 11: Start Time - NaN, End Time - NaN
Event 12: Start Time - NaN, End Time - NaN
Event 13: Start Time - NaN, End Time - NaN
Event 14: Start Time - NaN, End Time - NaN
Event 15: Start Time - NaN, End Time - NaN
how can i extract event start time and end time?

Antworten (2)

Satwik
Satwik am 13 Jul. 2023
Bearbeitet: Satwik am 13 Jul. 2023
Hi Ajay,
I understand that you are having trouble loading a .event file in MATLAB and parsing it to get the data.
First, check your code to make sure that the file_path variable has a closing quotation mark. If it does not, the code will not be able to find the file.
If the issue still exists then there are a few checks you can do
  1. You can check the loadOpenEphysEvents function to see if it is returning any data/
  2. Finally, you can verify that the data is a 2-column array
If you are still having trouble after making these changes, please provide me with the openephys file itself and I will be happy to take a look at it.
I hope this helps!

Ajay Kumar
Ajay Kumar am 13 Jul. 2023
Hi Satwik,
Thank you for your help, really apreciated.
I ttried all i am still facing probplem.
I am attching the .event file.
looking forward hearning from you.
Thanks you.

Kategorien

Mehr zu EEG/MEG/ECoG finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by