Function Objects — Their Methods and Properties

When you create an object that accesses a function declared in your source code, or a library function in your project, the object constructor createobj returns a function object. createobj uses the information in your source code to set the properties of the object appropriately to match the code. Within the properties and their values, you find all the information about the function, so that MATLAB understands how to handle the function in your MATLAB workspace and how to run the function on your processor.

Unlike memory and register objects, function objects do not inherit properties from a parent class.

Properties of Function Objects

Object properties can include both properties that the object inherits from its superclass, if any, and some properties that are unique to the class itself. For this reason, many objects in Embedded IDE Link CC share common properties; as you use the objects you will become familiar with the common and special properties for each.

Property NameProperty TypeDefault ValueDescription

address

mxArray

0

Returns the starting memory address for the function

filename

string

None

Reports the name of the file that contains the function

inputnames

mxArray

ASCII

Lists the name of the input arguments for the function

inputvars

MATLAB handle

None

Handles to the objects that access each input argument to the function. Created when you create the function object

link

MATLAB handle

None

Identifies the name of the link object you used to create the associated embedded object

name

string

None

Name of the register symbol in the symbol table

outputvar

MATLAB handle

None

Handles to the object that accesses the output argument from the function. Created when you create the function object

savedregs

mxArray

ASCII

Lists the names of the processor registers that are saved during processing. Contents of saved registers are preserved after you run a function or program

timeout

double

10 s

Specifies how long MATLAB waits for calls to the function to complete their work

type

string

ASCII

Specifies the function return type

variables

mxArray

ASCII

Lists the names of variables in the function

Methods of Function Objects

Like properties, methods for objects may come from the superclass or derive only from the class itself. For example, the cast and convert methods do not appear in all objects; listing them here indicates that the object does not inherit these methods but provides them itself

NameOverloaded?Description
addregister

No

Add registers to the saved register list

cleanup

No

Restore CCS to the state it was in before you ran a function. Restores the register contents to their previous state as well

copy

Yes

Make a copy of the function object

declare

No

Provide a function declaration to MATLAB

deleteregister

No

Remove a register you added to the saved register list

display

Yes

Return the properties of the function

execute

No

Run a function or program

getinput

No

Get information about one or more input arguments for a function

getoutput

No

Get information about the output argument for a function

list

Yes

Return information about one or more variables in your function

read

Yes

Read a value from memory on the processor

resume

Yes

Restart execution of a paused or stopped process

run

Yes

Run a program or function. Similar to execute

write

Yes

Write to the processor memory

  


 © 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