Home Forums SYSTEM How to export a graph from OptiSystem into MATLAB

Viewing 8 reply threads
  • Author
    Posts
    • #10965
      Ahmad Mustafa
      Participant

      Hi all,

      I want to export the data from Oscilloscope Visualizer in OptiSystem into MATLAB. I know how to export the data associated with a particular parameter from OptiSystem into MATLAB but I want to know how can all the data which creates the signal waveform in Oscilloscope Visualizer be exported to MATLAB at once.

      I am running 100 sweeps in one OptiSystem simulation so I do not want to manually save the data in a text file for obvious reasons 🙂

      Many Thanks.

      Best,
      Ahmad

    • #11039
      Ahmad Mustafa
      Participant

      Hi,

      I found the solution myself after trying more new things. The solution lies in the following .m and .osd file 🙂

      MatlabOptiSysBER.m
      OpticalLinkProject.osd

      Instead of using “GetValue”, one has to use “GetGraph” and follow the relevant routine given in the above mentioned .m file.

      Cheers,
      Ahmad

      • #11084
        Damian Marek
        Participant

        Thanks for sharing your answer Ahmad!

        • #43031
          ramin ravaghi
          Participant

          Hi

          I am working on my final project and I really need to help.I want to export an optical wave from Optical time Domain into MATLAB.

          I writed “OutputPort1=InputPort1” in matlab but i am not able to see Optical wave by “plot (OutptPort1)”

          please tell me matlab code.
          tnx

    • #11242
      Tech Support
      Participant

      Here’s some additional information from our OptiSystem team:

      —————————————————————————————————-
      The best way to immediately save data into Matlab is with the Matlab component

      We would add a signal fork at the location at which you would like to retrieve the data (connecting one of the forks to the Matlab component).

      As an example an m-file can be created that reads in an electrical signal and horizontally concatenates the vector (from each sweep) to an array (thus creating a large signal array representing all the sweeps). The example setup is shown in the enclosed images where a “SweepNum” parameter is first setup in the global parameters (from 1 to 5), followed by the “Amplitude” of the Pulse Generator (which is linked to the SweepNum) and a parameter SweepNum that is created in the Matlab component and linked also to the Global Parameter “SweepNum”.

      The m-file that can be used is shown below (and also enclosed).

      i = SweepNum;
      SignalVector = InputPort1.Sampled.Signal’;

      if i == 1
      TotalSignal = SignalVector;
      else
      TotalSignal = horzcat(TotalSignal,SignalVector);
      end
      —————————————————————————————————-

      • #19391
        Tu Nguyen
        Participant

        Good afternoon,
        Thank you for your contribution!
        Would you please check whether the simulation file I attached bellow runs successfully or not? I try to run it but the program stops and terminates automatically all the time.
        Thank you.

    • #11258
      Ahmad Mustafa
      Participant

      Many Thanks. This is much quicker.

    • #11298
      Sushank Chaudhary
      Participant

      Hi Tech Support,

      Thanks for sharing the quicker process. Can you tel me what is the procedure for exporting the mode profile into matlab. I want to calculate the beam diameter vs link transmission means how the beam diameter is reduced with respect to link transmission.

    • #17540
      christian
      Participant

      Hey there, Im trying to do a cosimulation with Optisystem and Matlab and i wanna try some trial or examples like the mentioned in this topic above, so can anyone please give me these MatlabOptiSysBER.m and OpticalLinkProject.osd files, as i said i wanna know how to do a cosimulation with matlab, if anyone have other files about it and can lend me, it will be helpfull to me and i’ll be thankfull with you.

      If anyone have the examples please send to my email is lcriollo@est.ups.edu.ec

      Thanks.

    • #17908
      mohammed mostafa
      Participant

      thanks a lot tech

    • #40688
      Kim Gaik Tay
      Participant

      Hi,

      I added in a matlab component and followed all instructions from Tech Support team, but how to get data export to Matlab so that i can plot in Matlab as can’t edit Legend text in Optisystem. Please refer to uploaded file.

      Thank you

    • #43115
      ramin ravaghi
      Participant

      Hi

      I am working on my final project and I really need to help.I want to export an optical wave from Optical time Domain into the MATLAB.

      I writed “OutputPort1=InputPort1” in matlab but i am not able to see Optical wave by “plot (OutptPort1)”
      could you tell me how i can do it.
      please tell me matlab code.
      tnx

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