M = padcatcell(C1, C2, ..., CN} concatenates the cell arrays C1 through CN into one large cell array M. These cells do not have to have the same number of elements. M will have N rows and the k-th row will contain the elements of the k-th cell array. Shorter inputs will be padded with empty cells. Note that the cells are always concatenated along the first dimension (in contrast to PADCAT).
[M, TF] = padcatcell (...) will return a logical array TF with the same size as M. TF is true where M holds an element from the original input. This is usefull to replace the padded empty cells with something else.
Example:
A = {'apple','ball','cat'}
B = {} ; % empty
C = {'dog' ; 'egg'} % note the column orientation
[M, TF] = padcatcell(A, B, C)
M(~TF) = {'-'}
Note: the cells are not limited to cell array of strings, they can hold any type of element.
See also cat, padcat, nones, strvcat, group2cell, catstruct
Cita come
Jos (10584) (2024). padcatcell (https://www.mathworks.com/matlabcentral/fileexchange/62290-padcatcell), MATLAB Central File Exchange. Recuperato .
Compatibilità della release di MATLAB
Compatibilità della piattaforma
Windows macOS LinuxCategorie
Tag
Riconoscimenti
Ispirato da: nones
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Scopri Live Editor
Crea script con codice, output e testo formattato in un unico documento eseguibile.