Photonics

Photonics

Post processig data after sweep in Matlab

    • Mehdi Heydari
      Subscriber

      Hi everyone, 

      I've run a multi level sweep in lumerical (on 3 different parameters) 

      and exported the data to matlab using script command: 

      matlabsave("P_TC2_Pol_1.0", P_TC2_Pol);

      Problem is when you open the file in matlab you will see that this struct size stored in P: 

      It is a two dimention (x.331 and y.3019). It stored all the power data in one column!!!! any suggestion to save data properly? 

    • Mehdi Heydari
      Subscriber

      I used reshape function to solve the problem. but it would be nice if we could export the data in a reasonable way directly. 

       

    • Guilin Sun
      Ansys Employee

      We do not have control of matlab. You may check, verrify and confirm the dataset and the matrices in Lumerical script environment before saving to matlab data.

      Please note that, there are some differences between Lumerical script and matlab. For example, FDTD uses auto non-uniform mesh, and the space varables xyz and E, H are non uniform. However if you directly send data to matlab, it will treat xyz in a uniform manner. eg, it recalculate x by linspace(min(x),max(x), length(x)), which creats uniform mesh.

      Therefore, before sending data to any 3rd party tools, please make sure the data is in consistent with their definition.

       

Viewing 2 reply threads
  • You must be logged in to reply to this topic.