Output Pop-Up Window
조회 수: 38 (최근 30일)
이전 댓글 표시
I want to make my displayed text in the output display as a popup window but I'm not sure now. My output currently reads "fprintf('Body mass changes by = %.5f +/- %.5f cm^3'" which in turn only gives these typed out in the command window. If you could help me get them to come up in a Pop Up window, thank you!
댓글 수: 0
답변 (1개)
Walter Roberson
2020년 6월 25일
편집: Walter Roberson
2020년 6월 25일
You can use msgbox() . If you look at the documentation for msgbox() you will see there is a way to configure using 'tex' interpreter to help with outputing symbols.
You will need to use compose() or sprintf() to construct the message. When you do that, be careful, because compose and sprintf both expect \ to be the introducer for "escape characters", such as \n coding for newline. That is a problem when you are trying to build up tex commands. You will need to code \\ in each place you want \ to be present in the tex .
Note that interpreter latex is not documented as being supported; however when I examine the code in R2020a, I see that latex is implemented.
댓글 수: 2
Walter Roberson
2020년 6월 25일
msg = sprintf('Body mass changes by = %.5f ± %.5f cm³\n', value1, value2);
h = msgbox(msg)
참고 항목
카테고리
Help Center 및 File Exchange에서 Text Files에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!