Import from Excel and exclude fully blank rows
古いコメントを表示
Hi everyone! I'm trying to modify a code generated by the import tool, thus making the code more flexible with respect to changes in the original Excel file.
The autogenerated code states:
raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''};
% Find row with blank cells
I = any(cellfun(@(x) isempty(x) || (ischar(x) && all(x==' ')),raw),2);
raw(I,:) = [];
This excludes rows with even a single blank cell. I want to import the whole Excel sheet and then exclude fully blank rows, how can I achieve this?
Thanks
3 件のコメント
Michal Dobai
2017 年 12 月 13 日
Just change
I = any(cellfun(@(x)...
to
I = all(cellfun(@(x)...
Francesco Ardia
2017 年 12 月 13 日
Michal Dobai
2017 年 12 月 13 日
Glad I could help. :)
I will post it as an answer, then.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!