How to add numeric values to table description?

2 Ansichten (letzte 30 Tage)
Sam17
Sam17 am 8 Aug. 2019
Kommentiert: Adam am 9 Aug. 2019
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?
  8 Kommentare
madhan ravi
madhan ravi am 8 Aug. 2019
Bearbeitet: madhan ravi am 8 Aug. 2019
Adam Danz , the guidance is the right tool , I support that too. I stopped caring about points a long time ago, if that's what you mean by "points". But honestly you could keep your answer too , it's also an informative one IMO.
Adam
Adam am 9 Aug. 2019
I sometimes give full answers, but I don't have time often, just popping in briefly while some code runs or whatever, so I mostly just add quick comments that can lead an inquisitive questioner in the right direction because it's fast for me too! Having to get the exactly correct syntax myself for what I'd call an 'answer' rather than a comment can take longer than I want often!

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

madhan ravi
madhan ravi am 8 Aug. 2019
Bearbeitet: madhan ravi am 8 Aug. 2019
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);

Weitere Antworten (0)

Kategorien

Mehr zu Characters and Strings finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by