MATLAB: How to define string scalars for a name(for example, one for the name and one for today’s date) in command windows

column vectormatricesstringstring literals

Sorry I'm new to matlab.
Is this what I'm supposed to do?
a=['Tim'];
b=['09/13'];
When I tried creating a column vector consisting of a and b, it said the matrices size don't match or something like that. Using the scalars defined above, how can you build and define a column vector of the info?

Best Answer

Use a cell array:
ab = {'Tim' datestr(now,'mm/dd')}
produces:
ab =
'Tim' '09/13'
The command:
ab{:}
produces:
ans =
Tim
ans =
09/13
and:
celldisp(ab)
produces:
ab{1} =
Tim
ab{2} =
09/13
and:
sprintf('%s\n\n', ab{:})
produces:
ans =
Tim
09/13
There may be other possibilities as well, but I can’t think of them just now.