Trying to display text and variable in a single output line. I was initially trying to use disp then a matrix then fprintf
조회 수: 413 (최근 30일)
이전 댓글 표시
채택된 답변
추가 답변 (1개)
Milly
2024년 6월 19일
편집: Milly
2024년 6월 20일
Not quite sure what issue the author had with the "disp" function but this should be the most efficient way to do this.
The given example would look like this:
var1 = 800;
disp("The answer is: " + var1 + " %")
The accepted answer using the disp function would look like this:
name = "Alice";
age = 12;
disp(name + " will be "+ age + " this year.")
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Entering Commands에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!