zoukankan      html  css  js  c++  java
  • matlabemacs运行matlab程序出错.不能调用matlab命令行模式

    在linux的emacs环境下运行matlab程序,一般需要安装以下三个程序,我是按照以下三个链接安装的(其实CEDET在新版本的emacs中有,只要配制一下就行了):

    CEDET matlab matlab-emacs

    不过在安装好matlab后记得把bin/matlab加入到环境变量,我的环境变量(这个怎么加请看linux的书籍)如下:


    我按照这个link配制matlab-emacs的时候,到达第4步matlab-shell就出问题,在emacs下总是调不出matlab的命令行模式,而出现如下错误提示:

    Searching for program: no such file or directory, matlab
    comint-send-string: Output file descriptor of MATLAB is closed


    我想,我已经把matlab的可执行文件加入到PATH了呀?为什么会之样呢,估计emacs中没有搜索到这个路径,那只能把它链接到/usr/bin,如下:

    aborn@aborn-lisp ~> sudo ln -s /usr/matlab/bin/matlab /usr/bin/matlab
    


    重新启动emacs,打开一个m文件,C-c C-s运行它就行啦,如下:


    附,我的matlab的配制如下(.emacs):

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;set matlab-emacs environment
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    (add-to-list 'load-path "~/.emacs.d/matlab-emacs/matlab-emacs")   ;matlab.el path
    (add-to-list 'load-path "/usr/matlab/bin/matlab")                 ; matlab path
    (require 'matlab-load)
    (autoload 'run-octave "octave-inf" nil t)                         ;special
    (autoload 'matlab-mode "matlab" "Enter MATLAB mode." t)
    (setq auto-mode-alist (cons '("\\.m\\'" . matlab-mode) auto-mode-alist))
    (autoload 'matlab-shell "matlab" "Interactive MATLAB mode." t)
    
    (setq matlab-indent-function-body t)    ; if you want function bodies indented
    (setq matlab-verify-on-save-flag nil)   ; turn off auto-verify on save
    (defun my-matlab-mode-hook ()
      (setq fill-column 76))		; where auto-fill should wrap
    (add-hook 'matlab-mode-hook 'my-matlab-mode-hook)
    (defun my-matlab-shell-mode-hook ()
      '())
    (add-hook 'matlab-shell-mode-hook 'my-matlab-shell-mode-hook)
    (global-font-lock-mode t)
    					;  To get hilit19 support try adding:
    (require 'tlc)
    (autoload 'tlc-mode "tlc" "tlc Editing Mode" t)
    (add-to-list 'auto-mode-alist '("\\.tlc$" . tlc-mode))
    (setq tlc-indent-function t)
    



  • 相关阅读:
    R中character和factor的as.integer的不同
    ggplot2练习
    R的plotmath
    Python数据科学手册(2) NumPy入门
    Python数据科学手册(1) IPython:超越Python
    ggplot2(6) 标度、坐标轴和图例
    R自带数据集
    ggplot2(5) 工具箱
    MATLAB神经网络(7) RBF网络的回归——非线性函数回归的实现
    ggplot2(4) 用图层构建图像
  • 原文地址:https://www.cnblogs.com/jiangu66/p/2997562.html
Copyright © 2011-2022 走看看