The end part of a set of cell arrays without loop
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Zeynab Mousavikhamene
el 2 de Dic. de 2019
Respondida: JESUS DAVID ARIZA ROYETH
el 2 de Dic. de 2019
I have data like this:
K>> aa(3:end)
ans =
9×1 cell array
{1×8 string}
{1×8 string}
{1×8 string}
{1×7 string}
{1×7 string}
{1×7 string}
{1×7 string}
{1×7 string}
{1×7 string}
and I need to choose the end of the "ans". Any idea how to do that? I dont want to use it for loop.
I tried to copy the aa(3:end) to another cell array like:
bb=aa(3:end);
but how can I choose the end part of each cell array without a loop?
0 comentarios
Respuestas (2)
JESUS DAVID ARIZA ROYETH
el 2 de Dic. de 2019
solution:
endpart=cellfun(@(x) x(end),aa(3:end))
0 comentarios
Ver también
Categorías
Más información sobre Cell Arrays en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!