Making a S-Function from a Matlab script

11 visualizaciones (últimos 30 días)
Eric
Eric el 13 de Jul. de 2012
Hi,
I would like to make a S-Function from a block I got in an opened model.
I would like to automate this from a Matlab script. Is there a function to generate S-Function directly from Matlab editor ?
Thanks,
Eric
  2 comentarios
Kaustubha Govind
Kaustubha Govind el 13 de Jul. de 2012
Your question is a little confusing. Did you want to generate an S-function from a Simulink block/subsystem using commands, or did you want to generate an S-function from MATLAB code so you can call it in Simulink?
Eric
Eric el 13 de Jul. de 2012
I got a block that I want to transform in S-Function like I can do by right-clicking on it with Real-Time Workshop.
However, I want this to be done by a matlab script without me actually going to right-click the block I want to put as a S-Function.
Thanks

Iniciar sesión para comentar.

Respuestas (1)

TAB
TAB el 13 de Jul. de 2012
Editada: TAB el 26 de Jul. de 2012
mdlName = 'YourModelName';
% Set the s-function target
set_param(mdlName,'SystemTargetFile','rtwsfcn.tlc');
% Build your subsystem
rtwbuild([mdlName '/' 'SubsystemName']);

Categorías

Más información sobre Simulink Coder en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by