Is it possible to load the input data from base workspace to the inports in the simulink model without enabling the external input in configuration parameters?
Show older comments
When working with Simulink models, it is often necessary to input data from external sources for simulation purposes. Typically, this can be done by specifying external inputs in the model's configuration parameters. However, there might be scenarios where you prefer or need to load the input data directly from the MATLAB base workspace to the inport blocks of a Simulink model, without enabling the configuration parameter settings for external inputs.
The input data is already available in the MATLAB workspace so can we directly assign it to the inport block ?
Accepted Answer
More Answers (1)
Vidhi Agarwal
on 30 Jul 2024
1 vote
Hi Sidhi,
I assume you are asking about a way to input data directly from MATLAB base workspace to the inport blocks of Simulink models without enabling the configuration parameter settings for external inputs.
You can follow given below steps to implement the same:
- Prepare the Input data in MATLAB workspace. Ensure that input data is available in the MATLAB workspace.
- Add a “From Workspace” Block to Your Simulink Model.
- Configure the “From Workspace” Block. Double-click on the “From Workspace” block to open its parameters dialog.
- Connect the “From Workspace” Block to the Inport Block: Connect the output of the “From Workspace” block to the corresponding Inport block in your Simulink model.
- Run your Simulink model. The input data from the MATLAB workspace will be fed into the Inport block via the “From Workspace” block.
For detailed understanding of “From Workspace” block please refer to following documentation.
Hope that Helps!
Categories
Find more on Event Functions 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!