- This topic has 15 replies, 5 voices, and was last updated 8 years, 9 months ago by alistu.
-
AuthorPosts
-
-
March 2, 2016 at 1:49 am #30848burhan num mina llahParticipant
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.
-
March 2, 2016 at 2:45 am #30862alistuParticipant
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
-
March 2, 2016 at 4:56 am #30876burhan num mina llahParticipant
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.
-
March 2, 2016 at 5:00 am #30878Aabid BabaParticipant
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
-
March 2, 2016 at 1:39 pm #31009alistuParticipant
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
-
-
March 2, 2016 at 7:59 am #30924burhan num mina llahParticipant
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
-
March 2, 2016 at 1:54 pm #31014alistuParticipant
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
-
-
March 2, 2016 at 8:12 am #30925Aabid BabaParticipant
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 -
March 2, 2016 at 8:22 am #30927burhan num mina llahParticipant
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
-
March 2, 2016 at 8:51 am #30931Aabid BabaParticipant
Hope it proves to be fruitful.
Good Luck -
March 2, 2016 at 9:02 am #30935Naazira BadarParticipant
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.
-
March 2, 2016 at 9:14 am #30938Aabid BabaParticipant
Yes Naazira she can do it for sure if she somehow manages to generate a C++ code for her simulink module.
-
March 2, 2016 at 9:19 am #30940burhan num mina llahParticipant
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
-
March 2, 2016 at 9:29 am #30945aasif bashir darParticipant
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
-
March 2, 2016 at 9:33 am #30947burhan num mina llahParticipant
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
-
March 2, 2016 at 9:44 am #30950aasif bashir darParticipant
you are welcome burhan num mina llah
-
-
AuthorPosts
- You must be logged in to reply to this topic.