Today is...
Wednesday, November 22, 2017
Welcome to, the global online
community of automation professionals.
Featured Video...
Featured Video
EtherCAT with CTC’s master lets your multivendor network play well together...
Our Advertisers
Help keep our servers running...
Patronize our advertisers!
Visit our Post Archive
connecting matlab m file to simulink
matlab m file programm as a block in simulink.

[moderator's note: See thread]

as a part of my project, i need matlab m file programm as a block in simulink. there are some user defined functions in simulink like sfunction. embedded matlab function blocks are available and i wrote the programs but shows some error... if any body can help me plz... i am doing simulation in simulink and to reduce the complexity. i thought of writing progms in m file but i failed to make it as a simulink block.. if anybody knows the way of using embedded matlab function plz

my email id is pinky1766 [at]


MATLAB has well-documented help and examples concerning S-Functions. Visit following folder in Simulink Library Browser: [Simulink->User-Defined Functions->S-Function examples] system for more information
Also, there is one more way to include m-file calculations into Simulink: write a general m-file function and use it within [Simulink->User-Defined Functions->MATLAB Function] library block

Best regards,