Skipping lines in datastore with read function
12 ビュー (過去 30 日間)
古いコメントを表示
Hello, I would like to access only to certain lines (rows) in my datastore and save them to a matrix. What I am doing now is:
1. Read all the datastore and save the data in a matrix.
2. Eliminate the data I don't want (by removing rows from the matrix).
It works, but I'm wasting a lot of time storing useless data in the first step. Is it a way to directly save the data that I want?
Information: my datastore is a collection of files, all of them with the same structure: two columns filled with numeric data. Each file has 100 rows, but I only want to save the first 60.
Thanks!
0 件のコメント
採用された回答
Amogh Bhole
2021 年 8 月 6 日
As per my understanding you are interested in reading only the top 60 rows from each file. It can be done efficiently using “readcell” function.
For each file you can use the below code to read top 60 rows:
C = readcell(filename,'Range',1:60);
Then save it in the matrix.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!