Atitit MATLAB 图像处理attilax总结

Atitit MATLAB 图像处理attilax总结

1.1. 下载 Matlab7.0官方下载_Matlab2012 v7.0 官方简体中文版-办公软件-系统大全.html1

1.2. Matlab cli接口 命令行执行m文件1

1.3. Matlab编程语言2

1.4. Matlab helo world3

1.5. matlab如何调用外部函数_百度知道.html3

1.6. matlab中如何定义函数3

1.7. 获取matlab的输出console3

2. qa4

2.1. Error: Missing variable or function.4

2.2. 出来个 “MATLAB Command Window” 4

2.3. 参考资料5

1.1. 下载 Matlab7.0官方下载_Matlab2012 v7.0 官方简体中文版-办公软件-系统大全.html

1.2. Matlab cli接口 命令行执行m文件

1. echo -r MATLAB_command - Start MATLAB and execute the MATLAB_command.

2. echo Any "M" file must be on the MATLAB path.

上面几个参数的意义上面说的比较明白了,如果大家有需要,我稍后翻译下~

基本上这样的执行方式就可以了:

1. matlab -nosplash -nodesktop -r test

复制代码

其中test就是你想执行的m文件的名字,如果你的文件放在启动后的当前目录下,那么就可以不加绝对路径了。

我在我的sublime里面新建了一个matlab的执行脚本:

1. {

2. "cmd": ["matlab", "-nosplash", "-nodesktop", "-r", "$file_base_name"],

3. "selector": "source.m"

4. }

5.

复制代码

这样就可以顺利的执行m文件了。

在Windows下

对windows而言,-nodisplay 似乎无效,还是会显示desktop; -nojvm, -nodesktop 不显示desktop,但是会出现简洁的command-line 窗口,也就是说并不会完全没有图形界面,无法像linux一样,只在cmdline操作

用Desktop > Desktop Layout > Command Window > Only 设置只显示 command-line interface 后,其他窗口并不会消失

另外 :

-r 运行matlab cmd命令,多条命令相互用分号或逗号隔开(空格不行),用双引号引起;一条命令可以不用双引号。 这多用在批处理模式下,所运行的文件必须在matlab的启动目录下或者在其搜索路径上,且不能带有路径名和后缀名,

-logfile 保存cmdline输出到文件

C:\MATLAB7\bin\win32\MATLAB.exe -nodisplay -nosplash -nodesktop -r "run('C:\MATLAB7\halo.M');" -logfile c:\matlabqc20.log

1.3. Matlab编程语言

%字符在MATLAB中多用来注释语

调用函数是以.m文件的文件名来调用的,如果文件里面含有多个函数则以文件中的出现的第一个函数为主函数,其他函数为局部函数进行调用,主函数名与文件名可以一致也可以不一致。

1.4. Matlab helo world

fprintf('Hello World');

% disp("haloworld");

% C:\MATLAB7\bin\win32\MATLAB.exe -nosplash -nodesktop -nodisplay -nojvm -r D:\0onvif_wsdl\halo

%C:\MATLAB7\bin\win32\MATLAB.bat -nosplash -nodesktop -nodisplay -nojvm -r disp("aa")

% C:\MATLAB7\bin\matlab.bat -nosplash -nodesktop -nodisplay -nojvm -r halo

C:\MATLAB7\bin\win32\MATLAB.exe -nodisplay -nosplash -nodesktop -r "run('C:\MATLAB7\halo.M');" -logfile c:\matlabqc20.log

1.5. matlab如何调用外部函数_百度知道.html

Matlab调用外部库函数方法和注意事项 - ghevinn欢迎您光临 - 博客频道 - CSDN.NET.html

Matlab如何调用其他m文件中的函数_百度文库.html

1.6. matlab中如何定义函数

matlab中如何定义函数_百度经验.html

1.7. 获取matlab的输出console

Win 默认弹出“MATLAB Command Window

只好使用 -logfile c:\matlabqc20.log 可以获取到输出 。还是弹出mcw窗口,只能invoke gui接口关闭了

To get started, type one of these: helpwin, helpdesk, or demo.

For product information, visit www.mathworks.com.

Warning: Function call halo invokes inexact match c:\matlab7\halo.M.

In run at 62

Hello World

不过貌似需要过滤。。这个输出的都是 Command Window里面的东东

2.1. Error: Missing variable or function.

M文件路径错误。

% C:\MATLAB7\bin\win32\MATLAB.exe -nosplash -nodesktop -nodisplay -nojvm -r D:\0onvif_wsdl\halo

貌似只能放在特定位置,只好放在 C:\MATLAB7\halo.m..

这下可以了,出来以下错误。

??? Undefined function or variable 'halo'.

不能直接-r m文件,需要执行run函数(m file)

2.2. 出来个“MATLAB Command Window”

"com.mathworks.mde.desk.MLDesktop.getInstance.closeCommandWindow;

不起作用

C:\MATLAB7\bin\win32\MATLAB.exe -nodisplay -nosplash -nodesktop -r "com.mathworks.mde.desk.MLDesktop.getInstance.closeCommandWindow;run('C:\MATLAB7\halo.M');"

价格logfile也不能隐藏吗貌似win系统就这样了,使用gui close吧。。

2.3. 参考资料

在matlab的命令窗口如何调用M文件_百度知道.html

命令行运行matlab_自由格子_新浪博客.html

Matlab_ Running an m-file from command-line - Stack Overflow.html

作者:: 绰号:老哇的爪子claw of Eagle 偶像破坏者Iconoclast image-smasher

捕鸟王"Bird Catcher 王中之王King of Kings 虔诚者Pious 宗教信仰捍卫者 Defender Of the Faith. 卡拉卡拉红斗篷 Caracalla red cloak

简称:: Emir Attilax Akbar 埃米尔 阿提拉克斯 阿克巴

全名::Emir Attilax Akbar bin Mahmud bin attila bin Solomon bin adam Al Rapanui 埃米尔 阿提拉克斯 阿克巴 本 马哈茂德 本 阿提拉 本 所罗门 本亚当 阿尔 拉帕努伊

常用名:艾提拉(艾龙), EMAIL:1466519819@qq.com

头衔:uke总部o2o负责人,全球网格化项目创始人,

uke宗教与文化融合事务部部长, uke宗教改革委员会副主席

,Uke部落首席大酋长,

uke制度与重大会议委员会委员长,uke保安部首席大队长,uke制度检查委员会副会长,

奶牛科技cto ,uke 首席cto

uke波利尼西亚区大区连锁负责人,克尔格伦群岛区连锁负责人,莱恩群岛区连锁负责人,uke汤加王国区域负责人。布维岛和南乔治亚和南桑威奇群岛大区连锁负责人

Uke软件标准化协会理事长理事长 uke终身教育学校副校长

Uke 数据库与存储标准化协会副会长 uke出版社编辑总编

Uke医院方面的创始人

转载请注明来源:attilax的专栏 ?http://www.cnblogs.com/attilax/

--Atiend