I am trying to concatenate the table elements of which each of them are double array. How can I do it effectively? I have attached the table for
reference. Basically I am trying to put together all the coordinatetimes values together.

댓글 수: 2

Walter Roberson
Walter Roberson 2022년 3월 19일
I am not clear what you are trying to concatenate to what, or which dimension you are trying to concatenate over?
Sorry for not being clear enough. I am trying to concatenate by column. I have written this piece of code which worked.
all_trials_on_date_coordinatetimes = [];
all_trials_on_date_xcoordinates = [];
all_trials_on_date_ycoordinates = [];
for idx = 1:length(all_trials_on_date.coordinatetimes)
all_trials_on_date_coordinatetimes = cat(1, ...
all_trials_on_date_coordinatetimes, ...
all_trials_on_date.coordinatetimes{idx, 1});
all_trials_on_date_xcoordinates = cat(1, ...
all_trials_on_date_xcoordinates, ...
all_trials_on_date.xcoordinates{idx, 1});
all_trials_on_date_ycoordinates = cat(1, ...
all_trials_on_date_ycoordinates, ...
all_trials_on_date.ycoordinates{idx, 1});
end
But, I am wondering if there is a simpler way for table which might not know.

댓글을 달려면 로그인하십시오.

 채택된 답변

Walter Roberson
Walter Roberson 2022년 3월 19일

0 개 추천

all_times = vertcat(all_trials_on_date.coordinatetimes{:});

댓글 수: 1

Atanu
Atanu 2022년 3월 19일
편집: Atanu 2022년 3월 19일
Awesome! Thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

제품

릴리스

R2022a

태그

질문:

2022년 3월 19일

편집:

2022년 3월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by