Installing Octave on Cygwin

8 篇文章 0 订阅
5 篇文章 0 订阅

GNU Octave is a high-level interactive language, primarily intended for numerical computations, that is mostly compatible with MATLAB®. (Another widely used alternative to Matlab is the Scilab, which seems to be more compatible with Windows platforms but more diverse from Matlab.) The following are the steps of installing Octave 3.6.4 within Cygwin 1.7.17 on Windows 8 Pro.


1. Installation

Use the cygwin setup.exe to select octave, octave-forge (octave-forge is similar to the MATLAB® toolboxes),gnuplot, and xinit packages. Other dependencies, such as xorg-server, will also be installed automatically.

During the installation, there is a error "pango1.0.sh exit code 1". But it does not seem to have caused any obvious issues [1].


2. Configuration

To launch X Window System (X11) and use xterm, the environmental variable DISPLAY should be set in ~/.bashrc.

export DISPLAY=:0

Otherwise, the error "DISPLAY is not set" will occur.

To make sure the plotting works well, run gnuplot in xterm (use "startx" or "xinit" to start X-Windows), and do "plot x w lines" to see whether a figure appears.

There might be strange errors related to "fork()" or .dll loading, after updating or installing packages [2]. This can be resolved by rebasing cygwin files, following the eight steps listed in [3].


3. Testing

As an example, start Octave in xterm, and test the scripts below. Printing and saving plots in Octave are described in [4].

octave:1> plot(sin(1:0.1:10))
octave:2> print -djpg foo.jpg

A prettier xterm may be set according to the steps in [5] (untested).


UPDATE: xterm setting

According to "man startx", when X starts, the configuration file in user's home directory '.xinitrc' will work, in which another configuration file ".Xresources" get called. Contents of both files are as below on my machine:

  • .xinitrc
    #!/bin/sh
    xrdb -load $HOME/.Xresources
    exec xterm -geometry 174x48+0+0 -name login

  • .Xresources
    Xft*antialias:          true
    Xft*autohint:           true
    XTerm*background:       black
    XTerm*foreground:       grey
    XTerm*cursorColor:      grey
    XTerm*scrollBar:        true
    XTerm*rightScrollBar:   true
    XTerm*saveLines:        10000
    XTerm*faceName:         Consolas
    XTerm*faceSize:         10
    XTerm*toolBar:          off
    XTerm*trueType:         true
    XTerm*scrollTtyOutput:  False

UPDATE2: python plotting in Cygwin

http://blog.csdn.net/lllcfr1/article/details/8628019


===========

[1] http://verahill.blogspot.hk/2013/03/353-cygwin-with-octave-and-gnuplot-on.html

[2] http://cygwin.wikia.com/wiki/Rebaseall

[3] http://stackoverflow.com/questions/9300722/cygwin-error-bash-fork-retry-resource-temporarily-unavailable

[4] http://www.gnu.org/software/octave/doc/interpreter/Printing-and-Saving-Plots.html

[5] http://stackoverflow.com/questions/7811314/change-default-xterm-font-size-in-cygwin


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值