xlswrite() cannot be used to write variables of arbitrary datatype to xls or xlsx files. It can only be used to write numeric arrays, or logical arrays, or cell arrays in which each entry is a numeric value, or a logical value, or a character vector (or, these days, a string() scalar).
writetable() can handle some additional datatypes, but some datatypes it will simply leave empty cells for. For example, it will leave empty cells for Control System Toolbox transfer functions, or for symbolic expressions.