| Embedded IDE Link™ CC | ![]() |
Define ANSI® C function declaration in MATLAB® environment for CCS application
declare(objname,'filetype','filename')
declare(objname,'decl','funcdeclaration')
When createobj cannot construct a function object to access a function, either because MATLAB software could not find the function declaration for the function, or could not create the function object properties, use declare to pass the function declaration to MATLAB software.
declare(objname,'filetype','filename') passes your function declaration string to objname by providing the path to the file specified in filename. To set the type of file you are providing, input argument filetype can be one of three strings:
'filename' — specifies that filename contains the path and filename for your header file that contains the function declaration
'file' — same as filename
'header' — specifies that filename is the path and name of a header file that contains the function declaration
When declare cannot find the declaration string because the specified header file or file is not available, use the next syntax to provide the complete declaration string explicitly.
declare(objname,'decl','funcdeclaration') passes the declaration string in funcdeclaration to objname. To tell MATLAB software that you are passing a declaration string, add the keyword decl, indicating that the next argument is the function declaration string. When you use declare to add a function declaration to objname, declare reads the input variables and return type for the declaration from funcdeclaration and populates the properties inputvars, inputnames, and outputvar of objname. When declare successfully determines the input and output variables, objname contains the updated property values.
The following code passes the function declaration for cdotprod to MATLAB software and updates the properties of ff to match the declaration:
declare(ff,'decl','int cdotprod (short x[], short y[], short n)')
In the case of a very complex function declaration, assign the declaration string to a variable and pass the variable in the declare syntax:
declstring=['int cdotprod (short x[], short y[], short n)'] declare(ff,'decl',declstring)
createobj, execute, getinput, getoutput, goto, resume, run
![]() | datatypemanager | delete | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |