help-octave
[Top][All Lists]
Advanced

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

Re: is_real_matrix()


From: Stefan van der Walt
Subject: Re: is_real_matrix()
Date: Sat, 1 Oct 2005 17:51:11 +0200
User-agent: Mutt/1.5.9i

Hi Søren

The most common way of checking parameters is

Matrix m = args(0).matrix_value();

if (error_state) {
        error("Input is not a real matrix");
        return ret;
}

Regards
Stéfan

On Sat, Oct 01, 2005 at 04:15:16PM +0200, Søren Hauberg wrote:
> Hi,
> In C++ (using 2.9.3), I've been using the 'is_real_matrix' function, but
> don't get the results I expect. This code:
> 
> if (args.length() != 1 || !args(0).is_real_matrix()) {
>     error("Input argument must be real matrix\n");
>     return ret;
> }
> Matrix Dkm1 = args(0).matrix_value();
> 
> doesn't return an error if args(0) is a string. It does however give me
> this error:
> 
> error: invalid conversion from string to real matrix
> 
> So how do I check if an input argument is a real matrix?
> 
> /Søren
> 
> 
> 
> -------------------------------------------------------------
> 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]