필터 지우기
필터 지우기

Displaying a description

조회 수: 2 (최근 30일)
NUR KHAIRUNNISA rahimi
NUR KHAIRUNNISA rahimi 2011년 10월 22일
How do I write a description for a program such that when I chose an option, the description of the program pop-out in the command window?
This question is pretty vague, I hope it's not too confusing
  댓글 수: 3
NUR KHAIRUNNISA rahimi
NUR KHAIRUNNISA rahimi 2011년 10월 23일
alright, so i wanted to write a description on a program, and I tried fprintf to display it on the command window when the user is asking for it but it said the input was too long.
Basically what I am asking for is the kind of command that would allow me to write something long, and will show on the command screen when called.
Fangjun Jiang
Fangjun Jiang 2011년 10월 23일
Okay then, can you show your code? I don't understand "but it said the input was too long." Here is an example.
Str=['This is a description',char(10)];
LongStr=repmat(Str,1,100);
clc;
disp(LongStr);
Is it long enough?

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

답변 (1개)

the cyclist
the cyclist 2011년 10월 23일
I believe you want the msgbox() command. Try this:
>> msgbox('This is the description that you wrote')
Read "doc msgbox" for details.
  댓글 수: 1
Walter Roberson
Walter Roberson 2011년 10월 23일
That wouldn't "pop out in the command window".
Seems to me that a simple function that does a bunch of fprintf() or disp() is all that is needed, and then to tie that function in as a callback to whatever the poster means by "choose an option".

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

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by