I need to connect physical modelling connection port to the output of a switch with 2 input. How can I establish this?
3 views (last 30 days)
Show older comments
Answers (1)
Umar
on 13 Jul 2024
Hi Shelma,
Place a Signal Routing block (e.g., Mux block) after the switch.Connect the output of the switch to the Signal Routing block. Then, connect the desired input port of the physical modeling connection block to the Signal Routing block.
4 Comments
Umar
on 28 Jul 2024
Hi Shelma,
Make sure that the output data types are compatible. Check the data types of the signals being passed between these blocks. If there is a mismatch, you may need to use data type conversion blocks like Data Type Conversion or Data Type Duplicate to ensure compatibility. Here is an example of how you can connect the Signal Conversion block to the Physical Modeling Connection block in Matlab:
% Create a Signal Conversion block
signalConversionBlock = Simulink.BlockDiagram.addBlock('built-in/Signal
Conversion', 'YourModel/SignalConversionBlock');
% Connect the output of the Mux block to the Signal Conversion block
add_line('YourModel', 'MuxBlock/1', 'SignalConversionBlock/1');
% Create a Physical Modeling Connection block
physicalModelingBlock = Simulink.BlockDiagram.addBlock('built-in/Physical
Modeling Connection', 'YourModel/PhysicalModelingBlock');
% Connect the Signal Conversion block to the Physical Modeling Connection block
add_line('YourModel', 'SignalConversionBlock/1', 'PhysicalModelingBlock/1');
By ensuring data type compatibility and following the correct block connections, you should be able to successfully link the Signal Conversion block to the Physical Modeling Connection block in Matlab.
See Also
Categories
Find more on Prepare Model Inputs and Outputs in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!