How can I build my own Simulink blocks in C? A tutorial for
communication systems designers
On 1st September 2005, Mike Woodward gave a seminar at The MathWorks
entitled "How can I build my own Simulink blocks in C? A tutorial for
communication systems designers". Several different files were used in
this seminar. All of the files were made available via MATLAB Central.
This note briefly explains what the files are. It should be read in
conjunction with the seminar.
The best way to use these files is to view the seminar first, and
then use the files. You can see the seminar here: http://www.mathworks.com/cmspro/req11029.html?eventid=31066
BERDemo.c is compiled into BERDemo.dll. This in turn is used in the
model umts_demo.mdl. umts_demo.mdl uses the file umts_demo_pre.m to set
up some initial variables needed to run the simulation.
OVSFCodeGenerator is a simple Visual Studio Project that prints out
the OVSF codes used in UMTS, given the spreading factor and code index.
It's main point of interest is the object UMTSOVSF.
UMTSOVSF is used (pretty much unaltered) in the Visual Studio
Project GenOVSF. GenOVSF compiles into a Windows dll (GenOVSF.dll)
which can be incorporated into a Simulink S-function - the S-function
requires two parameters, the spreading factor and the code index.
A great place to look for help is the MATLAB help system, which is
also available on-line here: http://www.mathworks.com/access/helpdesk/help/helpdesk.html
The section on S-functions in C can be found here: http://www.mathworks.com/access/helpdesk/help/toolbox/simulink/sfg/sfunc_c.html
If you need more help, a great place to look is in the technical
notes, which you can find here: http://www.mathworks.com/support/tech-notes/list_all.html
You can find the original seminar here: http://www.mathworks.com/cmspro/req11029.html?eventid=31066
© Copyright The MathWorks Inc., 2005.