Taking the last Row of each Double in a Cell

4 次查看(过去 30 天)
Hello,
I have a cell Coordinates (100x3) with inside all 14x8 double.
From these I would like to select all the doubles in the second column of the cell.
And to build a vector y_final than contains in each row the last row of all the doubles previously selected.
How can I do it?
Thanks in advance.

回答(1 个)

Githin George
Githin George 2022-7-21
Hi Fabio,
I understand you want to create a matrix - each row containing the last row of the 14x8 double in the 2nd column of the Cell.
I believe the following code snippet will give the desired output.
y_final= []
for i = 1:100
% temp contains the 14x8 double in 2nd column of the cell C
temp = C{i,2};
% appending 14th row of temp to y_final
y_final = [y_final; temp(14,:)];
end

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

产品


版本

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by