How to use "str2num" to read the first column of a comma separated data?
古いコメントを表示
I have a data file that consists of 8768 lines. The first 9 lines are header lines that are not in my interest. the lines below the header lines are tabular data with commas separating the elements of each column. The first column is a 4-digit number that states the year (e.g 1997).
My question is: How can I get the years from each row? (which is the same as the first 4 digits or the row or the digits before the first comma) and the command shall contain "str2num" notation.
回答 (1 件)
Matt Kindig
2012 年 4 月 2 日
str2num isn't really intended for this purpose. Why not use textscan, dlmread, or similar?
doc textscan
doc dlmread
カテゴリ
ヘルプ センター および File Exchange で Large Files and Big Data についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!