A Matlab command that will retrieve a variable from Lumerical workspace into Matlab workspace via Matlab interoperability API.
Syntax |
Description |
---|---|
x=appgetvar(h,'T'); |
Retrieves variable T from Lumerical workspace via an active session h and adds it into Matlab workspace as variable x |
Example
The following Matlab code example opens FDTD as a client, loads an existing simulation file "MySimulation.fsp", runs the simulation, retrieves transmission from the monitor into Matlab workspace and closes FDTD.
path(path,'C:\Program Files\Lumerical\FDTD\api\matlab'); %add Lumerical API path to Matlab; h=appopen('fdtd'); appevalscript(h,'load("MySimulation.fsp");'); appevalscript(h,'run;'); appevalscript(h,'T=transmission("monitor");'); appevalscript(h,'T=T.T;'); x=appgetvar(h,'T'); appclose(h);
See Also
appopen , appclose , appevalscript ,