Simulink coder converts fromFile block into fixed internal array with enumerated values

2 次查看(过去 30 天)
Hi I have a working Simulink model that uses a FromFile block to read the input data. When I build the model, it creates an internal array and initializes it with the entire contents of the file. The file is 3.8 Msamples long.
/* Start for FromFile: '<Root>/From File' */
{
static const real_T tuData[3847002] = { 0.0, 0.00025, 0.0005, 0.00075, 0.001,
0.00125, 0.0015, 0.00175, 0.002, 0.0022500000000000003, 0.0025, 0.00275,
0.003, 0.0032500000000000003, 0.0035, 0.00375, 0.004, 0.00425,
0.0045000000000000005, 0.00475, 0.005, 0.00525, 0.0055, 0.00575, 0.006,
0.00625, 0.0065000000000000006, 0.00675, 0.007, 0.00725, 0.0075, 0.00775,
This is idiotic. How can I get the code generator to create C code that uses a file read?
Thanks Sean

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulink Coder 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by