MATLAB Answers

Simulink Real-Time 2016b: the build process fails for the example model slrttest with error "Subscript indices must either be real positive integers or logicals"

13 views (last 30 days)
yxslzsh
yxslzsh on 31 May 2017
Answered: fei ma on 23 Jul 2019
I'm using Matlab 2016b with Visual Studio 2017, when I tried to build the example model named slrttestmdl from the Simulink Real-Time getting started tutorials, I got the error mentioned in the question. I have already installed the patches from https://www.mathworks.com/matlabcentral/answers/335092-can-i-use-microsoft-visual-studio-2017-with-matlab and specified Visual Studio 2017 as the C++ compiler. Here's the information from the diagnostic viewer:
### Starting Simulink Real-Time build procedure for model: slrttestmdl
Code Generation 1
Elapsed: 7 sec
### Generating code into build folder: D:\Develope\Matlab\slrttestmdl_slrt_rtw
### Invoking Target Language Compiler on slrttestmdl.rtw
### Using System Target File: C:\Program Files\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 slrttestmdl_capi.c
### Writing header file slrttestmdl_capi.h
### Writing header file slrttestmdl.h
### Writing header file slrttestmdl_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 slrttestmdl.c
### Writing header file slrttestmdl_private.h
### Writing header file rtmodel.h
### Writing source file slrttestmdl_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 slrttestmdl.xml
### Creating model slrttestmdl_ref.m
### Create mapping files
### Patch xml-file
### Processing Template Makefile: C:\Program Files\MATLAB\R2016b\toolbox\slrt\rtw\slrt_vc.tmf
Error: Subscript indices must either be real positive integers or logicals.
Can anyone help me with this? Thanks
  6 Comments
fuxin zhou
fuxin zhou on 26 Oct 2017
Hi jon,
I got the same problem. But the command is not working for my case. I still get same error. I have check with running a shaipped model like xpcosc. The same error pop up. Do you have alternative way to fix this error? Thanks

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by