Displaying text in the command window when running a program

Hi,
Am I being really stupid in failing to find how to display text in the command window when running my program?
Ie. I want to just have little sections of text that pop up explaining what is happening in the program-and I want these to be displayed in the command window for a user to see.
I have tried using the disp command, however as the text I am choosing to display has not been assigned to a variable so it will not work.
I guess one way to get around this, albeit messy, it is assign chunks of text to random variables and then choose the disp that variable-although it surely sounds like there is a tidier method.
Thanks in advance,
Mike Scott

댓글 수: 1

saisanthosh prasen
saisanthosh prasen 2016년 12월 2일
편집: per isakson 2016년 12월 2일
h = msgbox('Operation Completed'); using command like msgbox also u can get Pop up window...
For more details.. https://in.mathworks.com/help/matlab/ref/msgbox.html

댓글을 달려면 로그인하십시오.

 채택된 답변

Matt Fig
Matt Fig 2011년 4월 12일
What do you want to display? You can use the DISP command without a variable.
disp('At line 50')

댓글 수: 4

Thank you once again, I thought you could use the disp command. I must have been incorrectly using or missing a ;,' or similar symbol.
Regards,
Mike
Thank you once again, I thought you could use the disp command. I must have been incorrectly using or missing a ;,' or similar symbol.
Regards,
Mike
Using that code they are represented ans how can I represent them as one array with all the answers?(One array for an with all the ans and another for bn)?
disp('an=')
for i= 1:N
disp(ann(i))
end
disp('bn=')
for i= 1:N
disp(bnn(i))
end
Here is a link to related documentation:

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Function Creation에 대해 자세히 알아보기

제품

질문:

2011년 4월 12일

댓글:

2023년 8월 23일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by