Motorola DSP Developer's Kit | ![]() ![]() |
callMatlab
MATLAB engine library routines are incorporated into the supplied Suite56 DSP GUI Simulator to enable MATLAB functions and commands to be called from the simulator command window.
The syntax for the two ways of calling callMatlab
is:
callMatlab put <mem_space>:<start_address>:<end_address>
When "put
" is present, the DSP memory contents as specified by the last argument are copied into a variable in the current MATLAB engine session. The variable name is constructed from the colon-separated elements of the last argument.
callMatlab matlab_command
When called this way, the matlab_command
expression is passed to the MATLAB engine and evaluated there, as if entered at the MATLAB prompt.
The onus is on you to ensure that a valid MATLAB command is entered.
For example, issue the following two callMatlab
commands in the GUI simulator command window.
callMatlab put x:0:10 callMatlab plot(memx_0_10)
There is now a variable named memx_0_10
in the workspace of the MATLAB engine session created by the MEX function. The variable contains the DSP X memory block of 11 bytes from $0000 through to $000a inclusive.
A plot of the DSP memory block also appears after executing the MATLAB plot
command above.
![]() | Tutorial of Advanced Features | Data Snapshots | ![]() |