Good day Fabrice,
I am not sure which version of OptiSystem you are using but recommend taking a look at the OptiSystem samples folder under “Software interworking\MATLAB co-simulation”. There you will find example designs and a PDF application called “Matlab Electrical Example.pdf”. This should help you in setting up a basic MATLAB design for an electrical signal.
As a back up I have also posted the PDF to my response. Cheers