How to convert a 1x2 cell with 500x2 timetable to a 1000x2 timetable

1 view (last 30 days)
I'm trying to convert a 1xn cell with 500x2 timetable in both cells to a (500xn)x2 timetable. So the timetable should be written among each other to one huge timetable.
n=2;
for i=1:n
imu = mpu6050(a,'SampleRate',50,'SamplesPerRead',500,'ReadMode','oldest') %, 'OutputFormat', 'matrix'
imu_read = read (imu)
Out {i} = imu_read;
end
for i=1:n
table{i}=Out {1, i}
end
Here is the first step, where i tried to get the timetables out of the cell array, but i still got an cell array.
Thanks in advance!

Accepted Answer

Rik
Rik on 15 Jul 2022
I suspect this is what you need:
data_table=vertcat(Out{:});
You should probably avoid the variable name table, since that may cause problems with the data type.
  2 Comments
Rik
Rik on 15 Jul 2022
You're welcome. If I solved your issue, please consider marking my post as accepted answer. If not, feel free to comment with your remaining questions.

Sign in to comment.

More Answers (0)

Categories

Find more on Data Type Conversion in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!