Personal tools
You are here: Home Members TristanKing Tristan's blog Archive 2006 March 16 building Matlab actor

building Matlab actor

I'm in the process of building a Matlab Expression actor
This actor will give the user the abbility to run a matlab expression (i.e. a .m file) taking input from input ports and output certain results from user specified output ports.

if a user names an input port called "aaa" then a variable will be created for use called "aaa" with the value that is received from an input token.
similarly if a user makes a port called "aaa" and there is something in the matlab expression along the lines of "aaa = 2 + 2" then the value "4" will be output on the aaa port.

It works by using the java class java.lang.Runtime to start an instance of matlab using the command line "matlab -nodisplay -nosplay" (which starts matlab without a gui). it then sets the input port variables, runs the specified expression, extracts the values for the output ports, then quits matlab.

This method is taken directly from the RExpression actor which does the same thing but using R.

The only hard part is parsing the output string from matlab to extract the values we need. currently i can read in Double's Integers and Strings. Arrays of those 3 types will be the next challenge (and should be the final one).
Posted by TristanKing on 2006-03-16 16:33

Trackback

The URI to TrackBack this entry is: #


dart@dart.edu.au | DART Project Office, Monash University, Victoria 3800, Australia; Telephone +61 3 9905 4187; Facsimile +61 3 9905 3024