Code generation - export signals as struct

1 view (last 30 days)
Mauro
Mauro on 18 Jan 2012
I encapsulate my signals (and parameters) in structures. Currently I am able to do this defining my signals with a Storage Class "Struct(Custom)". This yelds the following code
in my_model.c file
my_signal_struct_type my_signals;
in my_model_types.h file:
/* Type definition for custom storage class: Struct */
typedef struct my_signal_struct_tag {
real_T u1;
real_T u2;
real_T u3;
} my_signal_struct_type;
Now I am in the need to export these definitions and declarations to files that can be shared. I see that it is possible to declare my signals of type mpt.Signal and use the Storage Class "ExportToFile(Custom)", like this my signals are defined in a separated C and H files.. and that is exactly what I need!!! Well, alsmost exactly, the problem is that every signal is declared as a stand alone variable. I need them to be part of a structure.
I believe that I need to create my own custom storage class and modify the MPTUnstructured.tlc file, but i don't know how to start.

Answers (0)

Categories

Find more on Structures in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!