How do I create a for loop to extract data from table?
Show older comments
Hii,
I have this table with a lot of data that i need to reorganize. This table consists of data from 9 participants, i want to have all the reaction times in 1 column per videostring, so every ID will have its own row with reactiontimes. In total i have 18 different videostrings, so the matrix will be [9,18]. However, i dont have some missing data, which means that for some videostrings i dont have any response times, here i need to have NaN or something else... See the attachment: dimensions are 159x3 while it should be 162x3 meaning that i miss 3 results. I really get stuck by trying to fix this.
How the matrix should look
(ID) 02stop.mp4 74524driving.mp4 .... (18 videostrings in total)
1 10672 11143 ....
2 198 7220 .....
3 10846 NaN ....
4 ... ...
....
I only got this far...:(
%%
ReactionTime = cat(2,resultsehmitrials(:,3),resultsehmitrials(:,5),resultsehmitrials(:,2)); %1 = videonames 2 = responsetime 3 = participant ID creates the Reactiontimetable
AnswersParticipants = NaN(9,18);
for nParticipanten = 1 : 9
for nVideos = 1 : 18
If someone could help me with to get started with this for loop I would be really thankfull!
Accepted Answer
More Answers (0)
Categories
Find more on Matrices and Arrays 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!