Home Forums SYSTEM How to add multiple matlab components

Viewing 3 reply threads
  • Author
    Posts
    • #19545
      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
      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
      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

      • #19571
        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

    • #19579
      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
        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.

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