仿真时总出现如下报错:
Error executing build command: Error using ==> make_rtw
Error using ==> tlc_c (InvokeTLC)
Error: File: C:\MATLAB6p5\rtw\c\tlc\lib\utillib.tlc Line: 173 Column: 8
%exit directive: Real-Time Workshop Fatal in block: "fangzhen/S-Function2", block type "S-Function": MFile S-functions without a corresponding TLC file are not supported. You can inline your S-function (Sa) by creating a TLC file for it. You can also remap your S-function to C by creating a corresponding C Mex source file and a Sa.tlc file in the same directory as the MFile S-function which contains (on the first line):
%% CallAsCMexLevel1
or
%% CallAsCMexLevel2
非常感谢,但是编译时还是不行
Installing the MATLAB Visual Studio add-in ...
Warning: Could not update D:\common\msdev98\template\MATLABWizard.awx
from C:\MATLAB6P5\BIN\WIN32\MATLABWizard.awx
Warning: Could not update D:\common\msdev98\template\MATLABWizard.hlp
from C:\MATLAB6P5\BIN\WIN32\MATLABWizard.hlp
Warning: Could not update D:\common\msdev98\addins\MATLABAddin.dll
from C:\MATLAB6P5\BIN\WIN32\MATLABAddin.dll
Warning: Could not update D:\common\msdev98\bin\usertype.dat
from C:\MATLAB6P5\BIN\WIN32\usertype.dat
Note: One or more components necessary to the operation of the MATLAB Visual
Studio add-in could not be installed. The MATLAB Visual Studio add-in
will not be available, but the rest of this setup operation will
continue normally.
>> mex Sa.c
C:\MATLAB6P5\BIN\WIN32\MEX.PL: Error: Compile of 'Sa.c' failed.
??? Error using ==> mex
Unable to complete successfully
苦恼
Select a compiler:
[1] Digital Visual Fortran version 6.0 in C:\Program Files\Microsoft Visual Studio
[2] Lcc C version 2.4 in C:\MATLAB6P5\sys\lcc
[3] Microsoft Visual C/C++ version 6.0 in D:
[0] None
我只有选择2的时候才可以编译成功,请问为什么1,3不行? 我的vc装在C:\Program Files里
选1的报告:
Please verify your choices:
Compiler: Digital Visual Fortran 6.0
Location: C:\Program Files\Microsoft Visual Studio
Are these correct?([y]/n): y
The default options file:
"C:\Documents and Settings\whb\Application Data\MathWorks\MATLAB\R13\mexopts.bat"
is being updated from C:\MATLAB6P5\BIN\WIN32\mexopts\df60opts.bat...
Warning! The MathWorks has determined that Digital Fortran 6.0 has several
serious bugs, and highly recommends that you upgrade to the latest version
of Compaq Fortran.
选3的报告
The default options file:
"C:\Documents and Settings\whb\Application Data\MathWorks\MATLAB\R13\mexopts.bat"
is being updated from C:\MATLAB6P5\BIN\WIN32\mexopts\msvc60opts.bat...
Installing the MATLAB Visual Studio add-in ...
Warning: Could not update C:\Program Files\Microsoft Visual Studio\common\msdev98\template\MATLABWizard.awx
from C:\MATLAB6P5\BIN\WIN32\MATLABWizard.awx
Warning: Could not update C:\Program Files\Microsoft Visual Studio\common\msdev98\template\MATLABWizard.hlp
from C:\MATLAB6P5\BIN\WIN32\MATLABWizard.hlp
Warning: Could not update C:\Program Files\Microsoft Visual Studio\common\msdev98\addins\MATLABAddin.dll
from C:\MATLAB6P5\BIN\WIN32\MATLABAddin.dll
Warning: Could not update C:\Program Files\Microsoft Visual Studio\common\msdev98\bin\usertype.dat
from C:\MATLAB6P5\BIN\WIN32\usertype.dat
Note: One or more components necessary to the operation of the MATLAB Visual
Studio add-in could not be installed. The MATLAB Visual Studio add-in
will not be available, but the rest of this setup operation will
continue normally.
Warning! The MathWorks has determined that Digital Fortran 6.0 has several
serious bugs, and highly recommends that you upgrade to the latest version
of Compaq Fortran.