In MatLab, all cells in my 60x1-cellarray contain a 10x1 double.
I would like to concatenate all these doubles vertically, except for the first number in every double.
My failed attempts was:
CellArray={[1 2 3];[1 2 3];[1 2 3]}
ContacenatedCellArray = vertcat(CellArray{:,1}(2:end))
This, obviously, did not work becauce CellArray{:,1}
refers to multiple cells so that (2:end)
is a bit silly.
Do you have any suggestions?
Thanks in advance!
Why not just do it in two lines:
temp = vertcat(CellArray{:}); %// or cell2mat(CellArray)
temp2 = temp(:,2:end)';
ContacenatedCellArray = temp2(:);
Try this -
%%// Vertically concatenated array
ContacenatedCellArray = cell2mat(CellArray);
%%// Use the first index of every double array to remove those
ContacenatedCellArray(1:10:end)=[];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With