Short answer is, "you can't".
A double array cannot have an empty element; it is either empty or full.
A cell array is the only way in which I see you can do this other than, perhaps you could cobble something together with sparse maybe???
The only alternative I see in an ordinary array would be to replace the empty cell with NaN or some other indicator value.
ses1_results{cellfun(@isempty,ses1_results)}=nan;
res=cell2mat(ses1_results);
res(res==0)=[];
returns
res =
1.1920
0.5678
1.0000
NaN
1.0000
>>
Or, of course, following the comment; you've already got a cell array; just remove the cells that are zero.
>> ses1_results(~cellfun(@(v)isequal(v,0),ses1_results))
ans =
5×1 cell array
{[ 1.1920]}
{[ 0.5678]}
{[ 1]}
{0×0 double}
{[ 1]}
>>
Best Answer