Add numbers to the matrix
Show older comments
Hi,
I am trying to refill excel matrix with the numbers and would like to ask if there are easy way to do it in matlab
I have matrices of 4 columns that log stimuli representation in time (logfile, attached below ). The rows are time and the columns are events. The first column logs stimuli id in time. (No stimulus =0, stimulus : 1 2 3 4 5 or 6) The second column logs the stimulus presentation time and its duration (0= No stimulus, 2=Stimulus); column 3 logs duration and ID of each trial. Each trial consists of pre-stimulus ,stimulus, and post-stimulus intervals. I need to add in 2d column numbers that would code for pre- and post-stimulus intervals for each trial as in example file attached below. Pre stimulus interval =1 (time from beginning of each trial till the stimulus presentation ) ; Post stimulus interval =3 (time after the end of the stimulus till the end of the trial). The log file and example file attached below
Could anyone help with this?
3 Comments
Dyuman Joshi
on 30 Sep 2023
"I need to add in 2d column numbers that would code for pre- and post-stimulus intervals for each trial as in example file attached below."
Can you explain the criteria/logic behind this? Perhaps with an example.
log=readtable('logfile (8).xlsx')
examp=readtable('logfile_example.xlsx')
Why is the example 25K where the other is 28K records?
Instead of 28K sized file that is far too big to be able to see easily what is going on, create a SMALL demo file of 50 records or less that illustrates the input and desired output and, as @Dyuman Joshi says, we need a defining logic statement that can be coded to set this other value -- for starters, it seems to be reusing the same indicator value for this pre-trigger and post-trigger indicator as is being used as a stimulus indicator, so how are they to be distinguished?
EK
on 30 Sep 2023
Accepted Answer
More Answers (0)
Categories
Find more on Startup and Shutdown 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!