How to find the corresponding value of an element in same row, but different column?
4 次查看(过去 30 天)
显示 更早的评论
Hi everyone,
Perhaps a silly question, but:
I have several matrices that are approx. 1500-2000 rows and 13 columns each (corresponding to single-trial data, so one matrix per trial; from deeplabcut if anyone is familiar). I have a for-loop that uses the find function to find a specific element in column #13 for each matrix and lists them in a single column (so if I have 50 trials, I would then have a column of 50 numbers). I now simply want to find the corresponding element in column #1 (from the same row!) for each trial and generate another such list. Column #1 contains timestamp information, so I'm looking for the timestamp corresponding to the element found in column #13.
Here is some dummy code so far (this is after narrowing the data down to a specific range):
element_list = find(data(:,13);
element_I_want = element_list(1)
element_timestamp = ????
Thank you!!! I've tried a few things but keep getting errors. I'm sure I'm just missing something simple.
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!