display a message in a message box
Ältere Kommentare anzeigen
i wanted to display a message in a message box saying...
Disease identified as Tumor,
Disease identified as Cancer, etc...
Disease identified as is constant.. tumor, cancer etc will be stored in a variable named as 'DiseaseIdentified' and i'll have to get it from that variable....
i did as below... but i'm getting error.... please could someone show me how to write it....
msgbox(sprintf('Disease identified as %s',DiseaseIdentified));
Akzeptierte Antwort
Weitere Antworten (1)
Azzi Abdelmalek
am 4 Jan. 2013
Bearbeitet: Azzi Abdelmalek
am 4 Jan. 2013
Maybe is that what you want
msgbox(sprintf('Disease identified as %d',1));
or
DiseaseIdentified='cancer'
msgbox(sprintf('Disease identified as %s',DiseaseIdentified));
3 Kommentare
Elysi Cochin
am 4 Jan. 2013
Bearbeitet: Elysi Cochin
am 4 Jan. 2013
Seban
am 4 Jan. 2013
As it said, you can't use cell input in sprintf. You need to make sure DiseaseIdentified is a string.
Azzi Abdelmalek
am 4 Jan. 2013
Use
DiseaseIdentified={'cancer'}
msgbox(sprintf('Disease identified as %s',DiseaseIdentified{1}));
Kategorien
Mehr zu Biological and Health Sciences finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!