Technical discussion about Matlab and issues related to Digital Signal Processing.
|
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 Yahoo! Groups SponsorADVERTISEMENT _____________________________________ /groups.php3 Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. --------------------------------- |
|
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 Yahoo! Groups Sponsor ADVERTISEMENT _____________________________________ /groups.php3 Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. --------------------------------- |