But I can't figure out how to delete whole rows of empty cells without reshaping of the original cell.
Would be nice if somebody could give me a solution.
I am sorry.
Kind regards,
Gudrun
>But I can't figure out how to delete whole rows of empty cells without reshaping of the original cell.
thecell( all(cellfun(@isempty,thecell),2), : ) = []
--
"MAMA: Oh--So now it's life. Money is life. Once upon a time freedom
used to be life--now it's money. I guess the world really do change.
WALTER: No--it was always money, Mama. We just didn't know about it."
-- Lorraine Hansberry
index=cellfun(@(x) isempty(x),resultdata);
%detect #rows and #columns for reshaping after deleting
sizeresultdata=size(resultdata,1).*size(resultdata,2);
number1=find(index==1);
remainingcells=sizeresultdata-length(number1);
numbercolumns=size(resultdata,2);
numberrows=remainingcells./numbercolumns;
%delete empty cells
resultdata(index)=[];
%reshape cell
resultdata=reshape(resultdata,numberrows,numbercolumns);
How I am supposed to know the all command as a new user? :)
Anyway, thank you very much.
Kind regards.
Gudrun
How can I delete the second column in this examples, so that the result will be
5 6
5 6
5 6
5 6
Kind regards,
Gudrun
array(:,2) = [];
Just make sure to use () instead of {}
"bluesaturn[at]kellnerweg.de" <blues...@kellnerweg.de>
wrote in message
<27550523.1206457983...@nitrogen.mathforum.
org>...