How do I count the number of columns in a csv file?
15 ビュー (過去 30 日間)
古いコメントを表示
I am trying to iterate through the number of columns as well as rows in an excel document. How do i assign a variable called numCols that stores the number of Columns with data in a csv file?
0 件のコメント
回答 (1 件)
Walter Roberson
2019 年 11 月 24 日
datatable = readtable('YourFile.csv', 'ReadVariableNames', false); %or true if there is a header
numRows = height(datatable);
numCols = width(datatable);
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で MATLAB Report Generator についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!