MATLAB: How to add numeric values to table description

descriptionstructuretable

I am trying to add some calculated values from a code and put it on the table description.
Let's say my table is MyTable
and the value is a=12
MyTable.Properties.Description='This table is the data from user number',a;
Basically, i want to keep the Description based on the variable a.
The output should be like this
Description: 'This table is the data from user number 12'
UserData: []
How do it do it?

Best Answer

t.Properties.Description = "This table is the data from user number " + a;
% or

t.Properties.Description= sprintf('This table is the data from user number %f',a); % as mentioned by colleagues above
% ^-- use d if you would like
% or
t.Properties.Description= compose("This table is the data from user number %d",a);
Related Question