2007年3月6日 星期二

Octave - linux版的Matlab

昨天晚上在上GA的時候,老師說上課要用Matlab,可是我是用linux,哪來的Matlab可以用,雖然Matlab有linux版,可是聽說要10張小朋友。

所以我就找了一些資料,發現在linux下有蠻多Matlab的替代軟體,像是Octave, Rlab還有R,這三套在linux上好像都蠻多人在用的。

Octave的首頁就這樣說了,「相容於Matlab」,所以拿來代替Matlab應該是再恰當也不過了。

GNU Octave is a high-level language, primarily intended for numerical computations. It provides a convenient command line interface for solving linear and nonlinear problems numerically, and for performing other numerical experiments using a language that is mostly compatible with Matlab. It may also be used as a batch-oriented language.

Rlab的首頁則是這樣子表示,「Rlab想要做的比Matlab更好」,可是原來的作者Ian Searle已經停止開發了。停止開發四年後,有另一位叫做Marijan Kostrum的人接手了Rlab的這個計畫,後來發展成Rlab plus。這感覺怎麼跟BMP和BMPx的關係好像 XDDDD

Rlab is an interactive, interpreted scientific programming environment. Rlab is a very high level language intended to provide fast prototyping and program development, as well as easy data-visualization, and processing. Rlab is not a clone of languages such as those used by tools like Matlab or Matrix-X/Xmath. However, as Rlab focuses on creating a good experimental environment (or laboratory) in which to do matrix math, it can be called ``Matlab-like''; since the programming language possesses similar operators and concepts.

R的首頁是說,「R是一個統計計算的語言」,感覺上好像跟Matlab的用處不同,所以我也沒有繼續再研究了。

R is a language and environment for statistical computing and graphics. It is a GNU project which is similar to the S language and environment which was developed at Bell Laboratories (formerly AT&T, now Lucent Technologies) by John Chambers and colleagues. R can be considered as a different implementation of S. There are some important differences, but much code written for S runs unaltered under R.

總之我現在是使用Octave了啦。要安裝Octave很簡單,反正就是apt-get就對了
sudo apt-get install octave2.9

不過Octave沒有內附的image generator,所以我們要利用gnuplot這套軟體來幫助Octave產生圖形。
sudo apt-get install gnuplot

安裝好之後我們就可以開始使用Octave啦,只要在終端機輸入octave就可以了

首先先輸入一個簡單的函式,看看能不能使用Octave+gnuplot來繪圖。

x=[0 2 4 7 10 12]
y=[3 4 0 6 1 3]
plot(x,y)


如果有出現下面的這個圖,那就大功告成啦!



參考資料:
Octave
Rlab Web Site
Welcome to the RLaB plus 1.0 website
The R Project for Statistical Computing
gnuplot homepage
幾個可以處理矩陣的計算機: octave/rlab/R

6 則留言:

阿鈞 提到...

octave 可以微分嗎?3q

kewang 提到...

我看到了一個function,叫做lsode。
不知道這個是不是你要的功能呢?

jim 提到...

那好像是解微分方程的

samefood 提到...

可以用wxMaxima來做符號運算的微分
例如:diff(x^4);

諭 提到...

呵~我研究的也是數值計算方面 , 目前成功脫離matlab有半年了 , 官方的tutorial
http://www.gnu.org/software/octave/doc/interpreter/
另外也有 scilab --> X window 的數值軟體唷

YungLee 提到...

試試看 Scilab ,我已進行中文化及中文教材撰寫請參考

http://science.openfoundry.org/ade/scilab/

歡迎提供意見

版主回覆:(08/04/2007 01:01:50 PM)


很棒耶,我會推薦給其他人試試看。