Taking the last Row of each Double in a Cell

4 Ansichten (letzte 30 Tage)
Fabio Taccaliti
Fabio Taccaliti am 17 Jul. 2022
Beantwortet: Githin George am 21 Jul. 2022
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.

Antworten (1)

Githin George
Githin George am 21 Jul. 2022
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

Kategorien

Mehr zu Programming finden Sie in Help Center und File Exchange

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by