[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: Calling sqrt() in a dynamic function

**From**: |
David Bateman |

**Subject**: |
Re: Calling sqrt() in a dynamic function |

**Date**: |
Tue, 10 Feb 2004 21:49:41 +0100 |

**User-agent**: |
Mutt/1.4.1i |

According to Thomas Weber <address@hidden> (on 02/10/04):
>* Hi, *
>* is there a way to call sqrt(X) (X a real matrix) from an .oct-file*
>* without using feval?*
>* *
>* I've grepped through the sources, but I am unable to find the definition*
>* of sqrt() for matrix arguments.*
There isn't a def'n. Its a mapper function, see ov-mapper.cc. How to use it
though that's another question. In fact using it will probably be so esoteric
you'd be better with something like
NDArray m = args(0).array_value();
for (int i=0; i < m.numel (); i++)
m(i) = sqrt (m(i));
Which is also good for N-D arrays..
D.
--
David Bateman address@hidden
Motorola CRM +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 1 69 35 77 01 (Fax)
91193 Gif-Sur-Yvette FRANCE
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary
-------------------------------------------------------------
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
-------------------------------------------------------------