MATLAB: How to find a certain content with index in cell array by looping

cell array by loopingMATLABsort cell array contents in 1x1 dimensionto sort contents of cell array

Dear senior,
I have a cell array like the following code. I want to sort like the following answer . How can I solve this? Help me. Thanks all.
if true
% 4 [] [] []
5 6 [] []
7 8 9 10
Desired Answer: 1x1 cell
4
5
6
7
8
9
10
end

Best Answer

A={4 [] [] []
5 6 [] []
7 8 9 10}
B=A'
idx=~cellfun(@isempty,B)
out=B(idx)