Find Empty Fields in Matrix and Delete them
4 views (last 30 days)
I am trying to create a FOR LOOP that deletes all the empty field in my matrix!
I have some rows that are full of data and some that are empty and I would like to learn the formula to do such!
I want to learn this please!
can someone demonstrate an example, Please? I am uncertain of the terminology to express!
Thank you in advance!
Rik on 21 Apr 2020
Edited: Rik on 21 Apr 2020
%generate fake data
%find all cells that don't contain data
L=cellfun('isempty',data);%faster than L=cellfun(@isempty,data);
%remove rows with any empty cell
You can also use L to loop through the elements that have data in them (just invert it with the ~ operator).