deleting all the empty rows
2 ビュー (過去 30 日間)
古いコメントを表示
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?
回答 (1 件)
Greg Heath
2012 年 7 月 13 日
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 件のコメント
Greg Heath
2014 年 9 月 25 日
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] []
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!