How to convert unconsistan cell array into 3d matrix?

1 Ansicht (letzte 30 Tage)
Shakir Hussain
Shakir Hussain am 7 Dez. 2018
Bearbeitet: Shakir Hussain am 7 Dez. 2018
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]));

Akzeptierte Antwort

madhan ravi
madhan ravi am 7 Dez. 2018
reshape([data{:}],730,360,[])
  3 Kommentare
madhan ravi
madhan ravi am 7 Dez. 2018
please attach your cell as .mat file to test
Shakir Hussain
Shakir Hussain am 7 Dez. 2018
Bearbeitet: Shakir Hussain am 7 Dez. 2018
I done it by dealing indiviual cell separately by simple cell2mat

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Cell Arrays finden Sie in Help Center und File Exchange

Produkte


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by