deleting all the empty rows
2 views (last 30 days)
Show older comments
Dear all,
I have
[N,T,R]]=xlsread(name);
I want to erase all the empty rows in T.
I suggest
T( all(cellfun(@isempty,T),2), : ) = [];
Am i correct?
Answers (1)
Greg Heath
on 13 Jul 2012
I don't think MATLAB allows empty rows or columns
>> A = [ 1 2 3; [] [] [] ; 7 8 9 ]
A = 1 2 3
7 8 9
>> A = [ 1 [] 3; 4 [] 6; 7 [] 9 ]
A = 1 3
4 6
7 9
>> A = [ [] 2 3; 4 [] 6; 7 8 [] ]
A = 2 3
4 6
7 8
Hope this helps.
Greg
2 Comments
Greg Heath
on 25 Sep 2014
Correct:
>> A = { 1 2 3; [] [] [] ; 7 8 9 }, B = { 1 [] 3; 4 [] 6; 7 [] 9 }, C = { [] 2 3; 4 [] 6; 7 8 [] }
A = [1] [2] [3]
[] [] []
[7] [8] [9]
B = [1] [] [3]
[4] [] [6]
[7] [] [9]
C = [] [2] [3]
[4] [] [6]
[7] [8] []
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!