Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How to print simple text to the console?

Subject: How to print simple text to the console?

From: Colin

Date: 16 Dec, 2008 16:48:02

Message: 1 of 4

Hi, I want to print error messages to the console when myfunction.m is used in the case that the input does not meet requirements.

Is there a simple function to print text?

Thanks.

Subject: How to print simple text to the console?

From: Kevin Neilsen

Date: 16 Dec, 2008 17:16:03

Message: 2 of 4

Disp('your message')

you could also do it through a pop up by using errordlg()

Subject: How to print simple text to the console?

From: Colin

Date: 16 Dec, 2008 17:36:03

Message: 3 of 4

Thanks you.

"Kevin Neilsen" <kevricio@hotmail.com> wrote in message <gi8noj$190$1@fred.mathworks.com>...
> Disp('your message')
>
> you could also do it through a pop up by using errordlg()

Subject: How to print simple text to the console?

From: Steven Lord

Date: 16 Dec, 2008 17:39:55

Message: 4 of 4


"Colin " <colinzhe@gmail.com> wrote in message
news:gi8m42$42s$1@fred.mathworks.com...
> Hi, I want to print error messages to the console when myfunction.m is
> used in the case that the input does not meet requirements.
>
> Is there a simple function to print text?

Yes, you could DISP or FPRINTF, but instead you probably want to terminate
the execution of your function, right? In that case, use ERROR or create
and THROW an MException.

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/error.html

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/mexception.html

--
Steve Lord
slord@mathworks.com

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us