replace nan with blank

17 views (last 30 days)
Amish
Amish on 14 Mar 2013
abc={1,[],'weak'} now i want to remove [] from above variable abc and give me abc={1,'weak'} only, can any one suggest me any method for it.

Accepted Answer

Andrei Bobrov
Andrei Bobrov on 14 Mar 2013
Edited: Andrei Bobrov on 14 Mar 2013
out = abc(~cellfun(@isempty,abc));
or
abc(cellfun(@isempty,abc)) = [];

More Answers (0)

Community Treasure Hunt

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

Start Hunting!