First, setup the RPC client in MATLAB as outlined in the Running PLECS Standalone from MATLAB tutorial.
From there, the basic setup is:
HOST_NAME='rtbox-123.local';
ip=java.net.InetAddress.getByName(HOST_NAME).getHostAddress();
proxy = jsonrpc('http://'+ip.string()+':9998/RPC2', 'Timeout', 10);
From there, you can access RT Box commands using proxy.rtbox.<function>
e.g. proxy.rtbox.querySimulation()
.