<< apifun_checkrange Check content Check size >>

Apifun >> Apifun > Check content > apifun_checkreal

apifun_checkreal

Generates an error if the variable has an imaginary part.

Calling Sequence

errmsg=apifun_checkreal(funname,var,varname,ivar)

Parameters

funname :

a 1-by-1 matrix of strings, the name of the calling function.

var :

a 1-by-1 matrix of valid Scilab data type, the variable

varname :

a 1-by-1 matrix of string, the name of the variable

ivar :

a 1-by-1 matrix of floating point integers, the index of the input argument in the calling sequence

errmsg :

a 1-by-1 matrix of strings, the error message. If there was no error, the error message is the empty matrix.

Description

This function is designed to be used to design functions where the input argument is real matrix of doubles. This function cannot be use when var is a function, or more generally, for any input argument for which the isreal function does not work.

Examples

// The function takes a real of matrix of doubles, or anything for
// which the isreal function can be called.
function y=myfunction(x)
apifun_checkreal ( "myfunction",x,"x",1 )
y = x
endfunction
// Calling sequences which work
y = myfunction ( 1 )
y = myfunction ( [1;2;3;4] )
// Calling sequences which generate an error
y = myfunction ( %i )

See also

Authors


<< apifun_checkrange Check content Check size >>