how to remove rows and columns in cell array ?

4 views (last 30 days)
Example :
i 29317x10 cell array
Name DOB age .............................. .address
ramesh 1994 25 sbc
suresh 1994 25 sbc
ram 1994 25 sbc
.
.
.
.
.
.
.
.
[ ] [ ] [ ]...................................... [ ] %25419 row
[ ] [ ] [ ]...................................... [ ]
[ ] [ ] [ ]...................................... [ ]
.
.
.
.
.
[ ] [ ] [ ]...................................... [ ] %29317 row
i want to remove these emtpy remove rowm 25419 to 29317 and all column wrt that row

Accepted Answer

Stephen23
Stephen23 on 29 Jul 2020
Edited: Stephen23 on 29 Jul 2020
Where C is your cell array:
C(25419:29317,:) = [];
You could also detect those rows automatically:
X = all(cellfun(@isempty,C),2);
C(X,:) = []
  2 Comments
Stephen23
Stephen23 on 29 Jul 2020
@KH: my pleasure. Please accept my answer if it helped you!

Sign in to comment.

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices 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!