MATLAB Answers


How to detect data type of Inport/Outport Signals of SIMULINK model via MATLAB code

Asked by Videet
on 20 Sep 2013

I am making a testing tool in which I need to detect the data type of signals coming out of Inports as well as data type of signals feeding Outports. I require to do this via MATLAB code.

Is there any command or method via which we can get details of data type of any link between two blocks of SIMULINK model to our MATLAB code?


Log in to comment.


No tags are associated with this question.


1 Answer

Answer by J Smith
on 20 Sep 2013
 Accepted Answer

to filter out Inports and outports you can use find_sys() and to get their data types, for every inport or outport block use

get_param('Inport or Outport Block Name','OutDataTypeStr')


i meant find_system,


AllBlocks= find_system(ModelName, 'Type', 'block');

for every Block in All Blocks, if Block Type is Inport or Outport (use

get_param(BlockName, 'BlockType') )

then find its data type by

get_param('Inport or Outport Block Name','OutDataTypeStr')

Dear, Elangovan Shanmugam Thank you for helping. This satisfied my requirement

Log in to comment.

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!