Selecting rows periodically from csv data file.
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a table of data as csv file. I want to pick every 10th row and discard all other rows. How can this be done in Matlab? I do not have access to function tableControl.
0 Kommentare
Antworten (1)
Voss
am 23 Mai 2022
You can read the whole thing using, for instance, readtable
t = readtable('test.csv');
or readmatrix
M = readmatrix('test.csv');
and then use indexing along the rows to keep just the rows you want:
t_keep = t(1:10:end,:) % perhaps keep every 10 rows, starting with row 1
t_keep = t(10:10:end,:) % or perhaps keep every 10 rows, starting with row 10
M_keep = M(1:10:end,:) % perhaps keep every 10 rows, starting with row 1
M_keep = M(10:10:end,:) % or perhaps keep every 10 rows, starting with row 10
0 Kommentare
Siehe auch
Kategorien
Mehr zu Tables finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!