Home Forums SYSTEM How to add multiple matlab components

How to add multiple matlab components

Profile Photo
(joined March 2015)
Participant

Hi all,

I wonder whether we can add multiple matlab components into one project? I added three matlab blocks into one project but I cannot see the signals from two other in the workspace. Do we need to name variable differently? i.e. OutputPort1=InputPort1;com_2_OutputPort1=com_2_InputPort1; com_3_OutputPort1=com_3_InputPort1
Please look at my example bellow
Thank you

Responses (5):

    • #19545
      Profile Photo
      Tu Nguyen
      Participant

      Hi all,

      I wonder whether we can add multiple matlab components into one project? I added three matlab blocks into one project but I cannot see the signals from two other in the workspace. Do we need to name variable differently? i.e. OutputPort1=InputPort1;com_2_OutputPort1=com_2_InputPort1; com_3_OutputPort1=com_3_InputPort1
      Please look at my example bellow
      Thank you

    • #19566
      Profile Photo
      Damian Marek
      Participant

      No you don’t need to change the variable names. The reason is because the Dual Port Oscilloscope was missing an input, so it displays nothing. If you place a normal Oscilloscope you will see the output (after renaming the variables back to the default).

    • #19569
      Profile Photo
      Tu Nguyen
      Participant

      Thank you, I have found out the problem.
      So, I wonder can we use more than one matlab component in the same project?is it ok? if it is fine, I think that the in/output’s names of different matlab components should be separated, but I dont know how to separate them without changing the default names.
      Thank you

      +1
      • #19571
        Profile Photo
        Damian Marek
        Participant

        Yes it is fine to use more than one Matlab component, I have never run into any problems with multiple Matlab components. Even the variables can have the same name, in fact if they are not all called Input_Port1, etc.. then I do not think the component will work properly.

        Regards

        +1
    • #19579
      Profile Photo
      Tu Nguyen
      Participant

      Thank you! yes, I agree, we can add multiple matlab components in a project. It runs, but how to differ signals belonging to each component in the Workspace? I used two Matlab components but I can only see the only one InputPort1 data in Workspace. How to see the other one?
      Thank you

      • #19580
        Profile Photo
        Damian Marek
        Participant

        During the simulation, the Matlab components are calculated in a certain order. The variables you see in the workspace belong to the last Matlab component calculated during the simulation. If there is a component you want to troubleshoot you should disable the other Matlab components.

Login You must be logged in to reply to this topic.