1

我的 r2013a Matlab 有问题。

我想使用 Simulink.ModelReference.protect('test') 命令保护模型。为此,我必须配置我的编译器。我正在使用 mex -setup 命令和 xpcsetCC -setup 命令。

起初,Matlab 说编译器没问题,但是当我尝试执行 Simulink.ModelReference.protect('model') 命令时,它显示一个错误,说没有可用的编译器。以下是命令序列:

第 1 部分 - 'mex -setup'

输入

mex -setup

输出

Welcome to mex -setup.  This utility will help you set up  
a default compiler.  For a list of supported compilers, see  
http://www.mathworks.com/support/compilers/R2013a/win64.html 

Please choose your compiler for building MEX-files: 

Would you like mex to locate installed compilers [y]/n?

输入

   y

输出

 Select a compiler: 
 [1] Intel C++ 12.0 (with Microsoft Software Development Kit (SDK) linker) in C:\Program Files (x86)\Intel\ComposerXE-2011\ 
 [2] Intel C++ 12.0 (with Microsoft Visual C++ 2010 linker) in C:\Program Files (x86)\Intel\ComposerXE-2011 
 [3] Microsoft Software Development Kit (SDK) 7.1 in C:\Program Files (x86)\Microsoft Visual Studio 10.0 
 [4] Microsoft Visual C++ 2010 in C:\Program Files (x86)\Microsoft Visual Studio 10.0 

 [0] None 

 Compiler:

输入

 4

输出

 Please verify your choices: 

Compiler: Microsoft Visual C++ 2010  
Location: C:\Program Files (x86)\Microsoft Visual Studio 10.0 

这些是正确的[y]/n吗?

输入

y

输出

*************************************************************************** 
  Warning: MEX-files generated using Microsoft Visual C++ 2010 require 
           that Microsoft Visual Studio 2010 run-time libraries be  
           available on the computer they are run on. 
           If you plan to redistribute your MEX-files to other MATLAB 
           users, be sure that they have the run-time libraries. 
*************************************************************************** 


Trying to update options file: C:\Users\Guilherme\AppData\Roaming\MathWorks\MATLAB\R2013a\mexopts.bat 
From template:              C:\PROGRA~1\MATLAB\R2013a\bin\win64\mexopts\msvc100opts.bat 

Done . . . 

************************************************************************** 
  Warning: The MATLAB C and Fortran API has changed to support MATLAB 
           variables with more than 2^32-1 elements.  In the near future 
           you will be required to update your code to utilize the new 
           API. You can find more information about this at: 
           http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html  
           Building with the -largeArrayDims option enables the new API. 
**************************************************************************

第 2 部分 - 'xpcsetCC -setup'

输入

xpcsetCC -setup

输出

 Select your compiler for xPC Target.


  [1] Microsoft Visual C++ Compilers 2010 Professional in C:\Program Files (x86)\Microsoft Visual Studio 10.0

  [0] None


  Compiler:

输入

1

输出

Verify your selection:

  Compiler: Microsoft Visual C++ Compilers 2010 Professional
  Location: C:\Program Files (x86)\Microsoft Visual Studio 10.0

  Are these correct [y]/n?Y

  Done... 

到目前为止一切正常,但接下来有一个错误:

第 3 部分 - Simulink.ModelReference.protect('test')

输入

 Simulink.ModelReference.protect('test')

输出

### Model reference SIM target (test_msp.mexw64) for model test is out of date because test_msp.mexw64 does not exist.
### Updating model reference SIM target for model: test
Warning: The model 'test' does not have continuous states, hence Simulink is using the solver 'VariableStepDiscrete' instead of solver 'ode45'.
You can disable this diagnostic by explicitly specifying a discrete solver in the solver tab of the Configuration Parameters dialog, or by
setting the 'Automatic solver parameter selection' diagnostic to 'none' in the Diagnostics tab of the Configuration Parameters dialog 
Warning: Using a default value of 0.2 for maximum step size.  The simulation step size will be equal to or less than this value.  You can disable
this diagnostic by setting 'Automatic solver parameter selection' diagnostic to 'none' in the Diagnostics page of the configuration parameters
  dialog 
  ### Build procedure for model: 'test' aborted due to an error.
  Error using Creator.protect (line 287)
  An installed compiler was not detected. Certain simulation modes, as well as host-based coder builds require that a compiler be installed. Please
  install one of the supported compilers for this release as listed at:

  http://www.mathworks.com/support/compilers/R2013a/win64.html

  MATLAB must be restarted after the compiler is installed.

  Error in C:\Program Files\MATLAB\R2013a\toolbox\simulink\simulink\+Simulink\+ModelReference\protect.p>protect (line 74)
  [harnessHandle, neededVars] = protectedModelCreator.protect(varargin{:});

我已经尝试了所有不同的可用编译器选择。我还尝试为第一个问题选择否mex -setup(“您希望 mex 找到已安装的编译器 [y]/n 吗?”)并手动选择编译器。这些都不起作用。

4

0 回答 0