|
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?
|