Hi all,
If I have a 100x1 cell array which contains 100 Nx4 double array where N is a variable size, how to I create a new cell array which is also 100x1, but contains a Nx3 double array that contains just columns 2,3 and 4 of the previous Nx4 array?
Hope that make sense! I'd appreciate any help with this problem.
Thanks in advance!

 채택된 답변

Ameer Hamza
Ameer Hamza 2020년 11월 27일

0 개 추천

You can use cellfun()
C1; % 100x1 with Nx4 matrices
C2 = cellfun(@(x) {x(:,2:end)}, C1);

댓글 수: 2

Amadeus Xu
Amadeus Xu 2020년 11월 27일
Thank you Ameer, that works perfectly!
Ameer Hamza
Ameer Hamza 2020년 11월 27일
I am glad to be of help!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Cell Arrays에 대해 자세히 알아보기

질문:

2020년 11월 27일

댓글:

2020년 11월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by