How to convert unconsistan cell array into 3d matrix?

조회 수: 1 (최근 30일)
Shakir Hussain
Shakir Hussain 2018년 12월 7일
편집: Shakir Hussain 2018년 12월 7일
I have cell array of daily temperature data of 18 years including leap year i.e 18*1 and each cell consist on 720*360*366/365 (normal year 365 and leap year 366).
I have found examples example 1 to cell array conversion in to matrix but these exmaples did not define unconsistance length of cells (different length).
I tried below codes but did not workd for me. Thank you in advacne for any help
test = cell2mat(cellfun(@transpose,data,'UniformOutput',0));
and
test = cell2mat(permute(cellfun(@cell2mat,data,'uni',0),[720,360,18]));

채택된 답변

madhan ravi
madhan ravi 2018년 12월 7일
reshape([data{:}],730,360,[])
  댓글 수: 3
madhan ravi
madhan ravi 2018년 12월 7일
please attach your cell as .mat file to test
Shakir Hussain
Shakir Hussain 2018년 12월 7일
편집: Shakir Hussain 2018년 12월 7일
I done it by dealing indiviual cell separately by simple cell2mat

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by