How to add numeric values to table description?
Mostra commenti meno recenti
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 Commenti
Adam
il 8 Ago 2019
doc sprintf
Adam Danz
il 8 Ago 2019
Ditto what Adam said....
Sam17
il 8 Ago 2019
I (and the other Adam) were trying to guide you there rather than give you the answer which teaches you nothing. Teach a person to fish.....
I gave an example in my answer below so you can manipulate it to your needs. There are more examples in the documentation which I also provided in my answer via a link. If you had executed the line provided by the other adam (doc sprintf) you would have seen documentation that explains this function, too.
madhan ravi
il 8 Ago 2019
"I gave an example in my answer below so you can manipulate it to your needs."
Why is that singular? Haven't I included an answer too ;-) ?
Points are nice, madhan but knowing that someone achieved the goal with your own guidance is even better IMHO. Clearly that's what Adam was doing and I support that.
@Sam17, madhan gave you what you were looking for but please take some time to read about sprintf() so you are more familiar with it next time. It's a useful function that you'll likely use often.
I moved my answer to here as a comment:
Read about this function and see examples here:
str = sprintf('This is example number %d', d);
madhan ravi
il 8 Ago 2019
Modificato: madhan ravi
il 8 Ago 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
il 9 Ago 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!
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Characters and Strings in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!