sahil
sahil

Reputation: 17

how to give input to the block 'model' in simulink

I am working in matlab simulink.There are two parts of my work.one is about control systems and the other is about image processing.I want to link them such that the control system part only receives a scalar input from image processing part.So i want to use the 'model' block attached to the image processing part such that there is a scalar input to the model block.How can I use this 'model' block such that it has an input port as I donot see any input port to this block.Please guide me.

Upvotes: 0

Views: 3117

Answers (1)

grungetta
grungetta

Reputation: 1097

The Model Block is used whenever you want to make use of a model inside of another model. This is something that is useful, for example, when multiple people are working on a large system that is comprised of multiple self-contained systems each of which could be its own model, but that could also act together in some useful way.

If you are just using Model Blocks for the sake of organizing subsystems together, then you should consider using Subsystems, instead. Subsystems allow you to group blocks together and do not require you to create separate models for each of your components (i.e. your Controller subsystem and your Image Processing subsystem). You can easily make a Subsystem either by dragging in the Subsystem block from the Simulink Library Browser, or by selecting components in your model, right-clicking, and selecting Create Subsystem from Selection.

However, if you actually do want to use Model Blocks, that can be done as follows. So, I'm assuming that you have already created two models -- one for your control system, the other for your image processing algorithm.

First, in each model, make sure you have specified the proper inputs/outputs. You will do this by adding Inport and Outport blocks to the top-level of each model.

Next, create a new model in which you will integrate the Control model and Image Processing model. Add a Model Block for each model (as you had already described doing). For each Model Block, open the Parameters dialog box. You will see a parameter where you can specify the model name. Enter the name of the model that you will be referencing (i.e. either the controller or image processing model). Additionally, you can browse for these models. Once you do that, the inputs and outputs that you had previously specified should now be visible on the Model Blocks.

Upvotes: 1

Related Questions