help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why is different ^ and .^?


From: Corbin Champion
Subject: Re: Why is different ^ and .^?
Date: Mon, 23 May 2005 22:28:52 +0000

It can't be "smarter." There has to be a way to distinguish between the two. If I gave you a square matrix it is completely valid to square the matrix as a whole or to square each element. The then can be no way for the computer to know the which you want, unless you tell it. I guess if it was a none square matrix it could automatically do a square of each element individually, but for a square matrix...you would still have to tell it what you want. I think others that handle this differently have a different syntax (but still two cases) or seperate functions for the two cases, but never just one.
Corbin

From: "Javier Arantegui Jimenez" <address@hidden>
To: "Mike Miller" <address@hidden>
CC: "Help-Octave List" <address@hidden>
Subject: Re: Why is different ^ and .^?
Date: Tue, 24 May 2005 00:17:33 +0200 (CEST)

Mike Miller said:
> a^2 means a*a
> a.^2 means "square every element of a"
>
> a^2  therefore requires that 'a' be a square matrix or scalar.
> a.^2 does not require that 'a' have any particular dimensions

OK. I understand it. But, could Octave be smart enough to distinguish
between those cases? I think that other programs, like Euler, don't need
to do this distinction.

Javier



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------





-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]