You need to iterate over all of the variables, find the ones that are numeric, and if the variable contains nan, then replace the variable with the formatted content of the numeric value, putting in blanks where-ever the nan were.
table() were not designed for presentation purposes, no Mathworks-provided function for this purpose.
YourTable = table([1;2;3;nan;5], {'a';'b';'c';'d';'e'}, [nan;12;13;14;15], rand(5,1))
YourTable = convertvars(YourTable, @isnumeric, @nanblank)
function output = nanblank(values)
mask = isnan(values);
if nnz(mask)
output = string(values);
output(mask) = "";
output = char(output);
else
output = values;
end
end
