Home Forums GENERAL simulink code generation

Viewing 13 reply threads
  • Author
    Posts
    • #30848

      I wanted to know that is there any provision to convert a simulink model into the matlab code which i later want to interface with optisystem. i had a model for packet communication of which i wanted to get the matlab code. I searched but found that i can generate only c++ code but when i attempted that i got this error which i am unable to mend.

    • #30862
      alistu
      Participant

      Hi Burhan,

      You have mentioned in your post about converting simulink model into Matlab codes. As far as I am concerned, you can use Matlab codes just to call simulink and do the calculations for an already saved simulink file (that is being called) and then export the result from simulink to Matlab.

      Regards

    • #30876

      Hi Alistu

      You mean i don’t need to convert it i can run it as it is and it would be simulated in simulink.

    • #30878
      Aabid Baba
      Participant

      Hi all.
      Alistu what do you exactly mean by ” use Matlab codes just to call simulink ” ?? Are you talking about calling Simulink in MATLAB or optisystem??
      And if so then first burhan num mina llah has to convert simulink into Matlab code .

      With Regards

      • #31009
        alistu
        Participant

        Hi Aabid,

        When you call Matlab by OptiSystem, you are not obviously converting OptiSystem program to Matlab program. You are just calling it. This is the same here. From your comment I assume you haven’t done it or worked much with simulink. I suggest going through discussions in Mathworks to understand more about simulink if necessary.

        Regards

    • #30924

      Hi Aabid

      Actually what i infer from Alistu is that i guess he means since for simulink we type a command in matlab so we can keep that command as it is in some m file and then include it in matlab component in the optisystem as we do in matlab interfacing.

      Regards

      Burhan

      • #31014
        alistu
        Participant

        Hi Burhan,

        Indeed this is how another program is called by Matlab, even when Matlab itself is called by OptiSystem. If still the concept of calling a program is somehow not familiar, I suggest you go through the Matlab co-simulation examples in OptiSystem samples where OptiSystem is called by Matlab in some of the provided examples.

        Regards

    • #30925
      Aabid Baba
      Participant

      okay i got it. If there is a provision of doing so then you would be able to pile up a whole code for your Simulink in MATLAB and proceed for interfacing the MATLAB module you would develop.
      Also i think optiwave should now include separate Simulink library just as they have done for Matlab , FSO and C++. It would be easy for users that way.
      Anyway it was nice discussing the topic. Hope it helped.
      Regards

    • #30927

      Hi all

      indeed it proved helpful , i would try to implement it in my project and see what it leads to. if this is possible then we don’t need convert simulink models to matlab codes when we can get the required results from using simulink models as such.

      Regards

      Burhan

    • #30931
      Aabid Baba
      Participant

      Hope it proves to be fruitful.
      Good Luck

    • #30935
      Naazira Badar
      Participant

      Hi Burhan..

      A nice discussion .
      Well you must be aware that now Optisystem has library for C ++ as well . So in case you get that code for your block, you could still use it without having to do with MATLAB or SIMULINK.

      Regards.

    • #30938
      Aabid Baba
      Participant

      Yes Naazira she can do it for sure if she somehow manages to generate a C++ code for her simulink module.

    • #30940

      Hi Naazira

      yeah that is there but the problem i was facing in matlab was solved to some level but the next error it shows is in the link below while i was trying to build c++ code from the simulink model. I actually believe that i don’t need to code for interfacing it with optisystem but to make changes that i require in my project i need to know the underlying code. That is why i need the code as well.

      Regards

      Burhan

    • #30945
      aasif bashir dar
      Participant

      hi all,

      burhan num mina llah if you some how manage to get the C++ code from the simulink module, i think your job is half done.because opti system 14 also supports c++ and optisystem co simulation.hope you can get code soon

      with the regards

    • #30947

      Hi Aasif

      i believe i have put the same thing above in my comment. I need help now in matlab and then only things might be easy for me. Anyways i appreciate your response. Thanks a lot all.

      Regards

      Burhan

    • #30950
      aasif bashir dar
      Participant

      you are welcome burhan num mina llah

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