Simulink query

Started by Adil Kidwai November 17, 2003
Hi all,
I have a query related to simulink in Matlab.
I have written a matlab code and i want to use that code as one of
the blocks in a system which i have designed using Simulink.

Does anyone has any idea how to do that. I searched the MAtlab help
and it talks about S-functions.If anyone have ever worked on such
stuff, please respond.

Regards,
Adil




Hi,
You have to use S-functions to make a user defined blocks in Simulink. S
functions can be written in Matlab,C or Fotran. If you carefully see in the
matlab-simulink directory it has a template for the s functions. U have to plug
in your code in to that template with the proper parameters. Like number of
inputs number of outputs, etc. Try to write a simple programme like y=x+2; and
put that code as a block.
Hope this helps.
-SaiRamesh.
Adil Kidwai <> wrote:Hi all,
I have a query related to simulink in Matlab.
I have written a matlab code and i want to use that code as one of
the blocks in a system which i have designed using Simulink.

Does anyone has any idea how to do that. I searched the MAtlab help
and it talks about S-functions.If anyone have ever worked on such
stuff, please respond.

Regards,
Adil
_____________________________________
Note: If you do a simple "reply" with your email client, only the author of this
message will receive your answer. You need to do a "reply all" if you want your
answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:

To Post:

To Leave:

Archives: http://www.yahoogroups.com/group/matlab

More DSP-Related Groups: http://www.dsprelated.com/groups.php3 ---------------------------------



Hi,

Open the Simulink Library Browser. Goto Simulink-->User-Defined
Functions-->MATLAB fcn. Include it in your model. You can then specify the
function you wish to use it for. Further help is available with it.

-Snehamoy
----- Original Message -----
From: Adil Kidwai
To:
Sent: Tuesday, November 18, 2003 3:02 AM
Subject: [matlab] Simulink query Hi all,
I have a query related to simulink in Matlab.
I have written a matlab code and i want to use that code as one of
the blocks in a system which i have designed using Simulink.

Does anyone has any idea how to do that. I searched the MAtlab help
and it talks about S-functions.If anyone have ever worked on such
stuff, please respond.

Regards,
Adil
_____________________________________
Note: If you do a simple "reply" with your email client, only the author of
this message will receive your answer. You need to do a "reply all" if you
want your answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join:

To Post:

To Leave:

Archives: http://www.yahoogroups.com/group/matlab

More DSP-Related Groups: http://www.dsprelated.com/groups.php3

---------------------------------