create a cell array of N dimensions of type char

2 visualizaciones (últimos 30 días)
Robert Scott
Robert Scott el 29 de Jul. de 2021
Comentada: Robert Scott el 29 de Jul. de 2021
As the title says,
How do i create a cell array of N dimensions of type char.
Thanks

Respuestas (1)

Dave B
Dave B el 29 de Jul. de 2021
Editada: Dave B el 29 de Jul. de 2021
A cell array has type cell, but you can use repelem/repmat to make a cell array where each cell contains an empty char:
If you want a cell array of size 1,n where each cell contains an empty char...
repelem({''},n)
Or for a cell of size m,n where each cell contains an empty char:
repmat({''},m,n)
For an n dimensional cell array, where the last dimension has a size>1, something like this:
sz=[1 2 3 4 5];
repmat({''},sz)

Categorías

Más información sobre Structures en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by