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:
ABS error

Subject: ABS error

From: John

Date: 20 Jun, 2011 20:22:04

Message: 1 of 6

What's wrong with how I've used ABS?

??? Undefined function or method 'ABS' for input arguments of type 'double'.

Error in ==> DPAnalysis2 at 113
                    if ABS(thrustx) <= 5 && ABS(thrusty) <=5 && ABS(moment) <=5

thrustx, thrusty, and moment are all values that have just been calculated. Thanks!

Subject: ABS error

From: Roger Stafford

Date: 20 Jun, 2011 20:29:05

Message: 2 of 6

"John " <johnps@gmail.com> wrote in message <itoa5c$lj5$1@newscl01ah.mathworks.com>...
> What's wrong with how I've used ABS?
>
> ??? Undefined function or method 'ABS' for input arguments of type 'double'.
>
> Error in ==> DPAnalysis2 at 113
> if ABS(thrustx) <= 5 && ABS(thrusty) <=5 && ABS(moment) <=5
>
> thrustx, thrusty, and moment are all values that have just been calculated. Thanks!
- - - - - - - -
  Matlab is case-sensitive. Use lowercase for 'abs'.

Roger Stafford

Subject: ABS error

From: John

Date: 20 Jun, 2011 20:43:02

Message: 3 of 6

"Roger Stafford" wrote in message <itoaih$mmp$1@newscl01ah.mathworks.com>...
> "John " <johnps@gmail.com> wrote in message <itoa5c$lj5$1@newscl01ah.mathworks.com>...
> > What's wrong with how I've used ABS?
> >
> > ??? Undefined function or method 'ABS' for input arguments of type 'double'.
> >
> > Error in ==> DPAnalysis2 at 113
> > if ABS(thrustx) <= 5 && ABS(thrusty) <=5 && ABS(moment) <=5
> >
> > thrustx, thrusty, and moment are all values that have just been calculated. Thanks!
> - - - - - - - -
> Matlab is case-sensitive. Use lowercase for 'abs'.
>
> Roger Stafford

Ahh, ok thanks. Too bad the "help" shows it in all caps!

Subject: ABS error

From: Nasser M. Abbasi

Date: 21 Jun, 2011 00:19:42

Message: 4 of 6

On 6/20/2011 1:43 PM, John wrote:

> Ahh, ok thanks. Too bad the "help" shows it in all caps!

I always wondered about that. Why help shows things
in uppercase.

I have a theory about this: Matlab originally was written
in FORTRAN, (now called Fortan) and Fortran is case insensitive,
and that is why when you do help in abs, exp, sin, etc.. they
all show in in UPPERCASE, because this is how people wrote Fortran
in the good old days. They used UPPERCASE. Look at old fortran
code, and you'll see it all UPPERCASE.

Most of the folks who wrote Matlab originally were expert Fortran
programmers (they had to, since Matlab was written in Fortran),
and so when they wrote the original help, they used what is
natural to them, which is uppercase.


--Nasser

Subject: ABS error

From: Roger Stafford

Date: 21 Jun, 2011 00:56:04

Message: 5 of 6

"Nasser M. Abbasi" <nma@12000.org> wrote in message <itoo2v$qei$1@speranza.aioe.org>...
> I have a theory about this: Matlab originally was written
> in FORTRAN, (now called Fortan) and Fortran is case insensitive,
> and that is why when you do help in abs, exp, sin, etc.. they
> all show in in UPPERCASE, because this is how people wrote Fortran
> in the good old days. They used UPPERCASE. Look at old fortran
> code, and you'll see it all UPPERCASE.
>
> Most of the folks who wrote Matlab originally were expert Fortran
> programmers (they had to, since Matlab was written in Fortran),
> and so when they wrote the original help, they used what is
> natural to them, which is uppercase.
>
> --Nasser
- - - - - - - - - - -
  Your theory might be right, Nasser, but I'll bet you would have one dickens of a time persuading MathWorks to redo all their help files and documentation to follow some different convention. They have a need to distinguish function and variable names from ordinary text.

Roger Stafford

Subject: ABS error

From: Greg Heath

Date: 21 Jun, 2011 01:28:46

Message: 6 of 6

On Jun 20, 8:56 pm, "Roger Stafford"
<ellieandrogerxy...@mindspring.com.invalid> wrote:
> "Nasser M. Abbasi" <n...@12000.org> wrote in message <itoo2v$qe...@speranza.aioe.org>...> I have a theory about this: Matlab originally was written
> > in FORTRAN, (now called Fortan) and Fortran is case insensitive,
> > and that is why when you do help in abs, exp, sin, etc.. they
> > all show in in UPPERCASE, because this is how people wrote Fortran
> > in the good old days. They used UPPERCASE. Look at old fortran
> > code, and you'll see it all UPPERCASE.
>
> > Most of the folks who wrote Matlab originally were expert Fortran
> > programmers (they had to, since Matlab was written in Fortran),
> > and so when they wrote the original help, they used what is
> > natural to them, which is uppercase.
>
> > --Nasser
>
> - - - - - - - - - - -
> Your theory might be right, Nasser, but I'll bet you would have one dickens of a time persuading MathWorks to redo all their help files and documentation to follow some different convention. They have a need to distinguish function and variable names from ordinary text.
>
> Roger Stafford

I agree it is a pain. However,
it is not hard to get used to it.

Greg

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