I had one structure in my code which was created with a function create_a_structure.m with a_struct = create_a_structure(). Several other functions either called this function, modified the values in the fields of this structure.
Using coder.cstructname(a_struct, 'a_struct') and a few tweaks, I've managed to have Matlab coder actually create a structure named a_struct in the generated code. Though the actual variable was named b_a_struct, and was declared in My_project_types.h. This made working with the generated code much easier.
Now, I wanted to add a second structure that should behave similarly, say b_struct. Having created similar functions to work with this new structure, I was expecting that a structure named b_struct would also be generated in the code generated by Matlab coder, but that simply is not the case.
I've since been struggling to replicate the behavior I've obtained with a_struct.
But in short:
How to force Matlab Coder to create C structures corresponding to Matlab structs used in the Matlab code?
EDIT: Writing a header by hand is not a solution, as I'm expecting the contents of this structure to change a bit often, and I'm planning to add more structs in a similar manner.