Home Forums SYSTEM MATLAB CO SIMULATION

Viewing 11 reply threads
  • Author
    Posts
    • #30715
      Idahor Emmanuel
      Participant

      HELLO,

      I am having problem co simulating my matlab with my optisystem design, can someone help please?

    • #30720
      Aabid Baba
      Participant

      Hello Idahor,
      Can you please explain what is the exact problem you are facing??

    • #30723
      Idahor Emmanuel
      Participant

      Thanks… Im having an undefined error of “parameter” when optisystem calculates the matlab component with electrical signal. i have attached the files for i have been facing the same error for more than a week.

    • #30734
      aasif bashir dar
      Participant

      hi all,

      there are number of previous posts already on forum,i suggest you to go through them. iT will completely provide you necessary information you would require.

      with regards

    • #30735
      Idahor Emmanuel
      Participant

      I have gone through most of it .. and thats how i was able to get a basic idea about it. It calls the matlab from optisystem but it has an undefined error.. thats what i dont understand.

      • #30758
        alistu
        Participant

        Hi Idahor,

        If these are the same files you have attached in the other forum page, the problem is that you have made a mention of “parameter0” in you Matlab codes, while such parameter is unknown to Matlab component. First you have to add it to the main tab of Matlab component properties using “add parameter” and then the problem is solved.

        Regards

    • #30791
      Aabid Baba
      Participant

      Hello Idahor,
      You are welcome.
      You have not defined this ‘parameter0’ in your Matlab code and Optisystem takes these as junk quantities. As alistu mentioned , you need to define this parameter in your Matlab code first and afterwards when you simulate it works fine. Hope it is helpful.

      With Regards

    • #31263
      Idahor Emmanuel
      Participant

      Thank you so much.. I have defined the parameter’0′.. and the error changed to a different thing. Now its saying an ‘end’ is missing in the code. I have checked and the number of end is correct… anyhelp please? i attached a picture of the error which i get… thanks

    • #31267
      Aabid Baba
      Participant

      Hi Idahor,
      i don’t see an ‘end’ command missing. Is it the full code you have put up here??
      With regards

    • #31273
      Idahor Emmanuel
      Participant

      Yes thats the same thing i saw it … and it kept giving me see error. i attached the system. and am getting the same error.

      • #31299
        alistu
        Participant

        Hi Idahor,

        I have downloaded the .m file from here and the program is different from the one you have attached the screen shot of in one of your previous replies. In this program, the error is still about Parameter0 not being defined in the Matlab program. Please check if you have attached the correct .m file.

        Regards

    • #31278
      aasif bashir dar
      Participant

      hi idahor,
      you jus put abnother ‘end’ statement at the end of code, may be it could work, but code seems to perfect tom me.
      with regards

    • #31300
      alistu
      Participant

      I see you have used Matlab program in OptiSystem Run Command box in the Matlab component. I suggest instead of that, you write your program in a separate .m file and only write the name of the file in Run Command and address it in the corresponding box in matlab component and then run the calculations.

    • #31412
      Idahor Emmanuel
      Participant

      Yes i have checked and i kinda fixed it… I fix one problem and another pops out. Its all part of the learning process i guess. I was able to call it as alitsu suggested but im having an error with my OutputPort1. From calculating the matlab component. The outputPort1 is the error now.

      • #31427
        alistu
        Participant

        Indeed it is a part of learning. I analyzed the modified system and realized your output is binary while your input is electrical. So when you use the command “OutputPort1=InputPort1”, you are creating an electrical output instead of a binary output. Besides, you never give the result of your calculations to the output vector in your program. Please verify if I am correct.

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