필터 지우기
필터 지우기

Combine cell array inside a cell array.

조회 수: 1 (최근 30일)
ANURAG DEEPAK
ANURAG DEEPAK 2021년 11월 14일
댓글: ANURAG DEEPAK 2021년 11월 14일
I want to combine the cell arrays inside a cell array. The only condition to combine is to select the cell array elements from second index starting from second cell array. For example:
A = cell(1, 3);
A(:) = {rand(1,3)};
The output variable B should be:
B = [0.7943 0.3112 0.5285 0.3112 0.5285 0.3112 0.5285];

채택된 답변

Walter Roberson
Walter Roberson 2021년 11월 14일
Last2 = @(V) V(2:end);
B = [A{1,1}, cell2mat(cellfun(Last2, A(2:end), 'uniform', 0))]
  댓글 수: 1
ANURAG DEEPAK
ANURAG DEEPAK 2021년 11월 14일
Thank you very much Sir for quick response.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by