help-octave
[Top][All Lists]
Advanced

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

Re: sqrt() of a Matrix in a DLD


From: Al Niessner
Subject: Re: sqrt() of a Matrix in a DLD
Date: Fri, 05 Mar 2004 13:16:28 -0800

I would like whatever sqrt() I use in my DLD to behave identically to
sqrt() at the octave interpreter.

Sorry if my earlier post made it sound like I wanted to do a
matrix-sqrt. I simply want to take the sqrt of every element in a
matrix.

On Fri, 2004-03-05 at 11:39, John W. Eaton wrote:
> On  5-Mar-2004, Al Niessner <address@hidden> wrote:
> 
> | I did a 'grep -i sqrt' in include/octave-2.1.52/octave and did not find
> | anything that would indicate how to take the square root of a matrix. My
> | m-file has sqrt(m) where m is a diagonal matrix. I could not find a
> | similar function in the header files. Anyone know the correct syntax?
> 
> I think this came up on the list recently.  In Octave, mapper
> functions like sqrt are implemented specially so that they can
> properly handle conversion from real to complex, etc.  For example, if
> you write
> 
>   sm = sqrt (m);
> 
> then sm will be complex if any element of m is negative.  Do you want
> to preserve that behavior in your C++ function?
> 
> jwe
-- 
Al Niessner <address@hidden>
Jet Propulsion Laboratory

All opinions stated above are mine and do not necessarily reflect 
those of JPL or NASA.

 ----
| dS | >= 0
 ----



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