Extract every 10th value from the excel file and save into new file

3 ビュー (過去 30 日間)
muhammad choudhry
muhammad choudhry 2021 年 3 月 23 日
コメント済み: muhammad choudhry 2021 年 3 月 23 日
Hi,
Attached file have 2 columns and 7177 rows. I want every 10th rows from both column extracted and in the end save into different csv file for example: 10th 20th 30th 40th so on, can anyone help. I am not sure how to do it.

採用された回答

David Hill
David Hill 2021 年 3 月 23 日
a=readmatrix('Book1.csv');
b=a(10:10:end,:);
writematrix(b,'Book2.csv');

その他の回答 (1 件)

Cris LaPierre
Cris LaPierre 2021 年 3 月 23 日
Use indexing (Ch 5 MATLAB Onramp).
You'll probably need to load the file into MATLAB (use readtable or readmatrix), copy every 10th row to a new table, then write that table to a new file using writetable or writematrix.

カテゴリ

Help Center および File ExchangeText Files についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by