Matlab R2016b & Simulink Real-Time : Subscript indices must either be real positive integers or logicals when compiling model

3 次查看(过去 30 天)
Hi !
I have a simulink model that I made and when I want to build it I got this :
### Starting Simulink Real-Time build procedure for model: ACMU_REGLAGE_PID
Code Generation 2 6
Elapsed: 8 sec
### Generating code into build folder: C:\Users\FX603988\Documents\MATLAB\Essais\ACMU_REGLAGE_PID_slrt_rtw
Parameter precision loss occurred for 'Threshold' of 'ACMU_REGLAGE_PID/Switch'. The parameter's value cannot be represented exactly using the run-time data type. A small quantization error has occurred. To disable this warning or error, in the Configuration Parameters > Diagnostics > Data Validity pane, set the 'Detect precision loss' option in the Parameters group to 'none'. [6 similar]
Component:Simulink | Category:BlockwarningSuppress this warning
### Invoking Target Language Compiler on ACMU_REGLAGE_PID.rtw
### Using System Target File: C:\MATLAB\R2016b\toolbox\slrt\rtw\slrt.tlc
[Warning: This model contains blocks that do not handle sample time
changes at runtime. To avoid incorrect results, only change
the sample time in the original model, then rebuild the model.]
### Loading TLC function libraries
### Initial pass through model to cache user defined code
### Caching model source code
...............................................................................
...........
### Generating TLC interface API.
...............................................................................
..........
### Writing source file ACMU_REGLAGE_PID_capi.c
### Writing header file ACMU_REGLAGE_PID_capi.h
### Writing header file ACMU_REGLAGE_PID.h
### Writing header file ACMU_REGLAGE_PID_types.h
.
### Writing header file rtwtypes.h
### Writing header file builtin_typeid_types.h
### Writing header file multiword_types.h
### Writing header file zero_crossing_types.h
### Writing source file ACMU_REGLAGE_PID.c
### Writing header file ACMU_REGLAGE_PID_private.h
.
### Writing header file rtmodel.h
### Writing source file ACMU_REGLAGE_PID_data.c
### Writing header file rt_nonfinite.h
### Writing source file rt_nonfinite.c
### Writing header file rt_defines.h
### Writing header file rtGetInf.h
.
### Writing source file rtGetInf.c
### Writing header file rtGetNaN.h
### Writing source file rtGetNaN.c
### TLC code generation complete.
### Creating xPC Options Header file xpcoptions.h.
.
### Creating xPC Definition File xpcvcdll.def
### Creating model Hierarchy xml ACMU_REGLAGE_PID.xml
### Creating model ACMU_REGLAGE_PID_ref.m
### Create mapping files
### Patch xml-file
.
### Processing Template Makefile: C:\MATLAB\R2016b\toolbox\slrt\rtw\slrt_vc.tmf
Subscript indices must either be real positive integers or logicals.
Component:Simulink | Category:Block diagramerror
I have Visual Studio Pro 2017 as compiler, and I did install the patch for 2016b.
Also fyi, I'm working in a big company which is quite paranoiac about IT rights, so I don't have administrator rights or installation rights, so I'm trying to figure out how to solve my problem with basically no rights ^^
Thanks for helping guys !

回答(1 个)

Diego Kuratli
Diego Kuratli 2019-9-15
This seems a compiler configuration issue. Type
>> slrtsetCC('VisualC','')
Then, select the VS2017 compiler using
>> mex -setup

产品


版本

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by