display a message in a message box
古いコメントを表示
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));
採用された回答
その他の回答 (1 件)
Azzi Abdelmalek
2013 年 1 月 4 日
編集済み: Azzi Abdelmalek
2013 年 1 月 4 日
Maybe is that what you want
msgbox(sprintf('Disease identified as %d',1));
or
DiseaseIdentified='cancer'
msgbox(sprintf('Disease identified as %s',DiseaseIdentified));
3 件のコメント
Elysi Cochin
2013 年 1 月 4 日
編集済み: Elysi Cochin
2013 年 1 月 4 日
Seban
2013 年 1 月 4 日
As it said, you can't use cell input in sprintf. You need to make sure DiseaseIdentified is a string.
Azzi Abdelmalek
2013 年 1 月 4 日
Use
DiseaseIdentified={'cancer'}
msgbox(sprintf('Disease identified as %s',DiseaseIdentified{1}));
カテゴリ
ヘルプ センター および File Exchange で Biological and Health Sciences についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!