matlab编译器如何使用默认设置
安装matlab_linux,linux下matlab的下载以及安装的参考连接,http://bbs.feng.com/read-htm-tid-6280022.html。
启动matlab,在matlab命令行上设置编译器,使用命令如下:
mex -setup
启动编译工具,deploytool,命令如下,安装图形界面添加需要编译的文件,并开始编译,可以编译成可执行文件或者动态链接库。若希望直接执行,编译成动可执行文件即可,若和其他语言混编,可以做成动态链接库,可以根据需要在图形界面上进行配置。本实验是做成一个可执行文件。
deploytool
假设应用程序名称为,Test,这编译完成后会生成一个Test文件夹,我们需要的可执行文件就在Test/distrib目录下。此时distrib 目录下面有两个文件,一个是run_Test.sh脚本文件和Test可执行文件。此时执行run_Test.sh文件,并不能执行,因为在Linux下,默认不会安装MCR,需要手动安装,MCR所在的路径为:matlab按照路径/toolbox/compiler/deploy/glnx86。安装完MCR后,执行如下命令,即可执行编译生成的Test文件。
run_Test.sh MCR_Install_Dir
若不想使用run_Test.sh脚本,直接运行Test文件,只需要设置两个环境变量即可,分别是:
export XAPPLRESDIR=/opt/matlab2009b/X11/app-defaults
LD_LIBRARY_PATH=/opt/matlab2009b/runtime/glnx86:/opt/matlab2009b/bin/glnx86:/opt/matlab2009b/sys/os/glnx86:/opt/matlab2009b/sys/java/jre/glnx86/jre/lib/i386/native_threads:/opt/matlab2009b/sys/java/jre/glnx86/jre/lib/i386/server:/opt/matlab2009b/sys/java/jre/glnx86/jre/lib/i386/client:/opt/matlab2009b/sys/java/jre/glnx86/jre/lib/i386
其中,/opt/matlab2009b,为matlab的安装路径,此时可以直接运行,Test文件了。
❷ 求助!matlab 设置错误 函数用不了 clc clear 什么的都用不了了(附图)
你自己是不是写了m文件,与系统m文件同名了?在系统中,现有的.m文件有的与***函数重名,所以matlab编译器不知道在遇到***的时候到底该执行哪一个函数。
解决:
把自定义的函数名改成其他名字。
❸ MATLAB中如何设置编译器
1. 安装
单独安装、和MATLAB同时安装。
2. 设置(以vs2005为例)
>> mbuild -setup
Please choose your compiler for building standalone MATLAB applications:
Would you like mbuild to locate installed compilers [y]/n? y
Select a compiler:
[1] Lcc-win32 C 2.4.1 in D:\PROGRA~1\MATLAB\R2010a\sys\lcc
[2] Microsoft Visual C++ 2008 SP1 in D:\Program Files\Microsoft Visual Studio 9.0
[3] Microsoft Visual C++ 2005 SP1 in C:\Program Files\Microsoft Visual Studio 8
[0] None
Compiler: 3
Please verify your choices:
Compiler: Microsoft Visual C++ 2005 SP1
Location: C:\Program Files\Microsoft Visual Studio 8
Are these correct [y]/n?
Trying to update options file: C:\Documents and Settings\Administrator\Application Data\MathWorks\MATLAB\R2010a\compopts.bat
From template: D:\PROGRA~1\MATLAB\R2010a\bin\win32\mbuildopts\msvc80compp.bat
Done . . .
3. 使用
(1)在 MATLAB 环境中使用 mcc 命令;
(2)在系统命令环境中使用 mcc.exe (在Windows上);
(3)在 MATLAB 环境中使用 Deployment Tool。
4. 程序发布
(1)使用 MATLAB 命令 builder;
(2)使用 Deployment Tool 图形化工具。
一般来说,需要发布的文件有3个:
(1)编译得到的可执行文件或库函数;
(2)CTF 文件;
(3)MCRInstaller.zip。
在最终用户的计算机上,首先需要把MCRInstaller.zip 解压,并把 MCR 中可执行文件所在目录添加到系统路径上,然后就可以使用编译后的程序了。
❹ 求大神看下,如何在matlab2014a中进行编译器的设置,发现和2008以及2010版的都不一样···
添加Matlab2013a与VS2013的支持文件
具体路径为:R2013a\bin\win32\mexopts
VS2013_Support_For_Matlab_2013_32bit.zip
因系统为32位,所以选择32bit下载,解压后的文件至mexopts目录下;
ok,至此可以编译,修改!
❺ MATLAB 如何配置编译器
在MATLAB的Command Window下输入命令 mbuild –setup,并根据MATLAB的提示选择合适的编译器,使用Microsoft Visual C++6.0,进行对C++连接环境的设置。
过程如下:
>> mbuild -setup
按照提示选择操作,选择编译器进行安装
然后,在MATLAB的Command Window下输入命令 mex –setup,进行对编译环境的设置。过程如下:
>> mex -setup
按照提示选择操作,选择你所需要的编译器就可以了。
❻ 如何设置matlab 编译器 mex
mex -setup
Please choose your compiler for building external interface (MEX) files:
Would you like mex to locate installed compilers [y]/n? y
Select a compiler:
[1] Lcc-win32 C 2.4.1 in D:\Programs\MATLAB\R2010a\sys\lcc
[2] Microsoft Visual C++ 2005 SP1 in D:\Program Files\Microsoft Visual Studio 8
[3] Microsoft Visual C++ 6.0 in C:\Program Files\Microsoft Visual Studio
[0] None
Compiler: 2
Please verify your choices:
Compiler: Microsoft Visual C++ 2005 SP1
Location: D:\Program Files\Microsoft Visual Studio 8
Are these correct [y]/n? y
Trying to update options file: C:\Documents and Settings\Administrator\Application Data\MathWorks\MATLAB\R2010a\mexopts.bat
From template: D:\Programs\MATLAB\R2010a\bin\win32\mexopts\msvc80opts.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/support/solutions/en/data/1-5C27B9/?solution=1-5C27B9
Building with the -largeArrayDims option enables the new API.
**************************************************************************