我已经在Sublime Text 2中编辑我的.m文件了(以下我的问题的其余部分称为Sublime)已经有一段时间了,并且最近习惯于使用Sublime中的构建函数来运行Python代码,我当时试图为MATLAB文件设置类似的东西.我试图这样做是因为我厌倦了运行我的代码并在单独的窗口中编辑我的代码.
在文档之后,我尝试使用下面这个非常合理的看似代码,其中'-r'标志启动MATLAB来运行我的文件,"-nodesktop"标志启动MATLAB而没有大笨重的Java GUI,以及"-nosplash"标志在没有不必要的启动画面的情况下启动MATLAB.选择器允许Sublime在m个文件上自动使用此构建系统,path变量设置将启动MATLAB的目录的路径(通过运行"which matlab"找到的目录).
我知道我可以在MATLAB GUI中设置一个首选的文本编辑器,但我对此并不感兴趣.我对使用Sublime作为构建系统以及文本编辑器感兴趣.
{
"cmd": ["matlab", "-r", "-nodesktop", "-nosplash", "$file_name"],
"selector": "source.m",
"path": "/usr/local/MATLAB/R2012a/bin"
}
Run Code Online (Sandbox Code Playgroud)
在我的无错文件.m文件上运行构建时,我发现下面的错误,这没有意义.我认为它没有意义,因为已经使用标准命令行选项启动了MATLAB,并且也接收到了MATLAB内部错误.
/usr/local/MATLAB/R2012a/bin/matlab: 1: /usr/local/MATLAB/R2012a/bin/matlab: awk: not found
/usr/local/MATLAB/R2012a/bin/matlab: 1: /usr/local/MATLAB/R2012a/bin/matlab: expr: not found
Internal error 2: Could not determine the path of the
MATLAB root directory.
original command path = /usr/local/MATLAB/R2012a/bin/matlab
current command path = /usr/local/MATLAB/R2012a/bin/matlab
Please contact:
MathWorks Technical Support
for further assistance.
[Finished in 0.1s with exit code 1]
Run Code Online (Sandbox Code Playgroud)
有没有其他人有这样的问题,通过备用构建系统调用MATLAB脚本?我没有尝试在Sublime上为除Ubuntu 12.04之外的任何其他操作系统设置MATLAB的构建系统,如果该信息有用的话.
它现在有效!
这是我的Matlab.sublime-build
:
{
"cmd": ["/usr/local/MATLAB/R2012a/bin/matlab", …
Run Code Online (Sandbox Code Playgroud) 如果还不是很明显,这是我第一天玩OpenCV.我希望做的是镜像frame2,然后上采样.
我不确定如何在这些类型为IplImage的帧上使用矩阵运算.我怎么能镜像我的frame2,然后将其上传到Webcam2窗口?以下是我的代码:
#include "cv.h"
#include "highgui.h"
#include <stdio.h>
// A Simple Camera Capture Framework
int main() {
CvCapture* capture = cvCaptureFromCAM( CV_CAP_ANY );
if ( !capture ) {
fprintf( stderr, "ERROR: capture is NULL \n" );
getchar();
return -1;
}
// Create a window in which the captured images will be presented
cvNamedWindow( "Webcam", CV_WINDOW_AUTOSIZE );
cvNamedWindow( "Webcam2", CV_WINDOW_AUTOSIZE );
// Show the image captured from the camera in the window and repeat
while ( 1 ) {
// Get …
Run Code Online (Sandbox Code Playgroud)