How to delete empty lines in a table

9 次查看(过去 30 天)
Hello all, I have an easy question for you. How would you delete all empty lines in a table? Thank you
  1 个评论
Image Analyst
Image Analyst 2016-7-3
Start with the last row and work up using a for loop. Are all the columns of the same data type, like double? Or is there a mix of data types? Can you supply a sample table?

请先登录,再进行评论。

回答(1 个)

Azzi Abdelmalek
Azzi Abdelmalek 2016-7-3
If A is your table
idx=all(cellfun(@isempty,A{:,:}),2)
A(idx,:)=[]

类别

Help CenterFile Exchange 中查找有关 Tables 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by