Thread Subject: Junk characters at end of warning() string when using less than < character

Subject: Junk characters at end of warning() string when using less than < character

From: Joshua Arnott

Date: 26 Oct, 2009 12:48:02

Message: 1 of 2

Hi,

I'm trying to throw a warning message:

warning('Scamp:outOfBounds',...
    'Equation in Chen and Millero (1977) only valid for 0 < P < 180 bar.')

If I run this command in the Matlab prompt, it displays as expected.

>> warning('Scamp:outOfBounds',...
    'Equation in Chen and Millero (1977) only valid for 0 < P < 180 bar.')
Warning: Equation in Chen and Millero (1977) only valid for 0 < P < 180 bar.
>>

However, if I include it in a function or plain M-file, I get three extra characters at the end of the warning:

>> warntest
Warning: Equation in Chen and Millero (1977) only valid for 0 < P < 180 bar.}
> In warntest at 1
>>

I'm not sure if they will display correctly here, but they are a right curly parenthesis , a hollow square and a space.

It seems to be the use of the less than sign (<) that is triggering this anomaly. Am I doing something incorrectly here? Is there something specific I need to do to display a less than in a warning?

Subject: Junk characters at end of warning() string when using less than <

From: bcomisky

Date: 26 Oct, 2009 20:14:13

Message: 2 of 2

On Oct 26, 8:48 am, "Joshua Arnott" <jnotjosh.arnottn...@lancs.ac.uk>
wrote:
> Hi,
>
> I'm trying to throw a warning message:
>
> warning('Scamp:outOfBounds',...
>     'Equation in Chen and Millero (1977) only valid for 0 < P < 180 bar.')
>
> If I run this command in the Matlab prompt, it displays as expected.
>
> >> warning('Scamp:outOfBounds',...
>
>     'Equation in Chen and Millero (1977) only valid for 0 < P < 180 bar.')
> Warning: Equation in Chen and Millero (1977) only valid for 0 < P < 180 bar.
>
>
>
> However, if I include it in a function or plain M-file, I get three extra characters at the end of the warning:
>
> >> warntest
>
> Warning: Equation in Chen and Millero (1977) only valid for 0 < P < 180 bar.}  
>
> > In warntest at 1
>
> I'm not sure if they will display correctly here, but they are a right curly parenthesis , a hollow square and a space.
>
> It seems to be the use of the less than sign (<) that is triggering this anomaly. Am I doing something incorrectly here? Is there something specific I need to do to display a less than in a warning?

Testing on R2009a, I see the warning without the extra characters you
mention. Which version of Matlab are you using?

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
warning Joshua Arnott 26 Oct, 2009 08:49:10
error Joshua Arnott 26 Oct, 2009 08:49:10
bug Joshua Arnott 26 Oct, 2009 08:49:10
string Joshua Arnott 26 Oct, 2009 08:49:10
rssFeed for this Thread

Contact us at files@mathworks.com