From help-request at octave dot org Tue Jan 18 06:05:43 2005 Subject: Re: Dynamic extensions: from octave_value to *double and vice versa From: Muthu To: Nicolo Giorgetti , help@octave.org Date: Tue, 18 Jan 2005 04:08:14 -0800 (PST) HI Nicolo! What you say is very easily possible. Please read the docs at http://wiki.octave.org and the CoDa documents. Checkout the 'info octave' and its section on dynamic extensions. For your case just do this: DEFUN_DLD(matrix_xyz,args,,"no comments") { Octave_Matrix x; x=args(0).matrix_value(); //make changes. x(1,1)=200-x.getElem(1,1); return octave_value(x); } Please lookinto the header file ov.h and use the member functions like octave_value v; v.string_value() v.integer_value(); v.ulong_value(); v.scalar_value() etc. Actually you will know that octave_value is a polymorphic base type that supports all the various operations in it. Cheers Muthu. __________________________________ Do you Yahoo!? The all-new My Yahoo! - What will yours do? http://my.yahoo.com ------------------------------------------------------------- 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 -------------------------------------------------------------