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!