################################################### # File: usr_matlab_optionA.lsf # # Description: This file will run the simulation. # It then gets the near field profile from the # monitor. The near field is imaged in FDTD, # then re-imaged in Matlab with the contour # function. # # Copyright 2009 Lumerical Solutions, Inc. ################################################### run; # run simulation # get mode profile E2=getelectric("monitor1"); x=getdata("monitor1","x"); y=getdata("monitor1","y"); # image data in FDTD Solutions image(x*1e6,y*1e6,E2, "x (um)","y (um)","E2"); # Send data to the Matlab workspace matlabput(E2,x,y); # create the plot with a series of # Matlab commands matlab(" [X Y]=meshgrid(x,y); contourf(X*1e6,Y*1e6,flipud(transpose(E2)),8); title('{Mode1 |E|}^{2}'); xlabel('{X (\mum)}'); ylabel('{Y (\mum)}'); colorbar; ");