- You can check the loadOpenEphysEvents function to see if it is returning any data/
- Finally, you can verify that the data is a 2-column array
to convert .events to .mat
1 view (last 30 days)
Show older comments
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?
0 Comments
Answers (2)
Satwik
on 13 Jul 2023
Edited: Satwik
on 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
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!
0 Comments
See Also
Categories
Find more on Data Import and Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!