データストアを使用し​、CSVファイルの指​定列、指定行のデータ​を抽出

matlab 2018aを使用しています。
CSVファイルの指定列のデータを抜き出したくてtabularTextDatastore
SelectedVariableNamesを使用しています。
さらに指定行のデータを抜き出したいと思ったのですがデータストアを使用して抽出すことはできるのでしょうか。

 采纳的回答

Kazuya
Kazuya 2018-11-17

1 个投票

読み取る行に関しては NumHeaderLines プロパティで読み飛ばす行数を設定するか、ReadSize で読み取る行数を決めるくらいしか手段がないですね。ファイルの特定の行だけを読み取るなら、この2つで何とかなりそうですが、どうでしょう?

1 个评论

yuuji yamada
yuuji yamada 2018-11-18
なんとかなりそうです。ありがとうございました。

请先登录,再进行评论。

更多回答(1 个)

madhan ravi
madhan ravi 2018-11-17

0 个投票

Read the while file using readtable() and then you can simply specify as such
T=readtable('mycsv.csv');
T.column %where T is your table and columns is the specific column you need

2 个评论

yuuji yamada
yuuji yamada 2018-11-18
ありがとうございます。ためしてみます。
madhan ravi
madhan ravi 2018-11-18
Anytime :) , sure!

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!