필터 지우기
필터 지우기

The end part of a set of cell arrays without loop

조회 수: 1 (최근 30일)
Zeynab Mousavikhamene
Zeynab Mousavikhamene 2019년 12월 2일
답변: JESUS DAVID ARIZA ROYETH 2019년 12월 2일
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?

답변 (2개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 12월 2일

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH 2019년 12월 2일
solution:
endpart=cellfun(@(x) x(end),aa(3:end))

카테고리

Help CenterFile Exchange에서 Cell Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by