Creating cell with NaN
42 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Daneisha Blair
am 23 Aug. 2021
Kommentiert: Daneisha Blair
am 24 Aug. 2021
Hi,
I would like to re-create a NaN array like the attached image below. Meaning, the size of the array will be 1x187, but inside the array I rather each cell be a mx1. Example 2x1, 10x1, 3x1, 13x1, 4x1, etc.
Any help is appreciated.
0 Kommentare
Akzeptierte Antwort
the cyclist
am 24 Aug. 2021
I was not 100% clear on what you wanted. Is this output right?
% Input array
C = {["Mercury","Gemini", "Apollo"; ...
"Skylab", "Skylab B","ISS"], ...
["Mercury","Gemini";
"Skylab","Skylab B"]}
% Output array
out = cellfun(@(x) nan(size(x,1),1) ,C,'UniformOutput',false)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!