how to remove rows and columns in cell array ?

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

thank you Stephen!!!
@KH: my pleasure. Please accept my answer if it helped you!

Sign in to comment.

More Answers (0)

Categories

Asked:

kH
on 29 Jul 2020

Commented:

on 29 Jul 2020

Community Treasure Hunt

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

Start Hunting!