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

23 views (last 30 days)
yuuji yamada
yuuji yamada on 17 Nov 2018
Commented: madhan ravi on 18 Nov 2018
matlab 2018aを使用しています。
CSVファイルの指定列のデータを抜き出したくてtabularTextDatastore
SelectedVariableNamesを使用しています。
さらに指定行のデータを抜き出したいと思ったのですがデータストアを使用して抽出すことはできるのでしょうか。

Accepted Answer

Kazuya
Kazuya on 17 Nov 2018
読み取る行に関しては NumHeaderLines プロパティで読み飛ばす行数を設定するか、ReadSize で読み取る行数を決めるくらいしか手段がないですね。ファイルの特定の行だけを読み取るなら、この2つで何とかなりそうですが、どうでしょう?
  1 Comment
yuuji yamada
yuuji yamada on 18 Nov 2018
なんとかなりそうです。ありがとうございました。

Sign in to comment.

More Answers (1)

madhan ravi
madhan ravi on 17 Nov 2018
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 Comments
yuuji yamada
yuuji yamada on 18 Nov 2018
ありがとうございます。ためしてみます。
madhan ravi
madhan ravi on 18 Nov 2018
Anytime :) , sure!

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!