
How to export a graph from OptiSystem into MATLAB
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
Responses (13):
-
April 24, 2014 at 11:52 am #10965
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 -
April 25, 2014 at 4:46 am #11039
Hi,
I found the solution myself after trying more new things. The solution lies in the following .m and .osd file 🙂
MatlabOptiSysBER.m
OpticalLinkProject.osdInstead of using “GetValue”, one has to use “GetGraph” and follow the relevant routine given in the above mentioned .m file.
Cheers,
Ahmad+2-
April 25, 2014 at 3:26 pm #11084
Thanks for sharing your answer Ahmad!
+2-
April 18, 2017 at 6:06 am #43031
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
-
-
-
April 29, 2014 at 6:14 pm #11242
Here’s some additional information from our OptiSystem team:
—————————————————————————————————-
The best way to immediately save data into Matlab is with the Matlab componentWe 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
—————————————————————————————————-+2-
April 8, 2015 at 7:56 am #19391
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.
-
-
April 30, 2014 at 9:05 am #11258
Many Thanks. This is much quicker.
-
May 1, 2014 at 5:05 am #11298
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.
-
February 9, 2015 at 6:31 pm #17540
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.
-
February 27, 2015 at 3:26 pm #17908
thanks a lot tech
-
June 16, 2016 at 7:09 am #40688
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
Attachments:
-
April 21, 2017 at 8:11 am #43115
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
Login You must be logged in to reply to this topic.