GNU Octave & Scilab

 没想到Matlab文章分类下的第一篇文章不是关于Matlab的。 而是关于开源软件Octave和Scilab的。

Octave和Scilab是两款开源的用于数值计算的科学软件包,用过Matlab的同学, 这两款也很容易上手。

先说GNU Octave

因为最近对Ubuntu 11.04很新奇, 所以最近更多的是在Linux下学习。 最近要提交一个医学图像处理作业, 但又懒得切换到Windows下, 就下载了个Octave试试, 没想到还真给力。

一些信息:

版本:3.2.4-8 (octave3.2)

总大小:占用 31.1 MB 磁盘空间

Octave is a (mostly Matlab (R) compatible) high-level language, primarily intended for numerical computations. It provides a convenient command-line interface for solving linear and nonlinear problems numerically.

Octave uses some of the best and most respected numerical libraries as balgen, dassl, eispack, fftpack, lapack, linpack, minpack, odepack, ranlib, slatec-fn and villad. Octave can be dynamically extended with user-supplied C++ files.

因为安装的组件比较少, 所以安装的很快。 那么这么mini的小软件。 做起来图像处理如何呢?

sy@ubuntu:~$ octave
GNU Octave, version 3.2.4
Copyright (C) 2009 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type `warranty'.

Octave was configured for "i686-pc-linux-gnu".

Additional information about Octave is available at http://www.octave.org.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/help-wanted.html

Report bugs to  (but first, please read
http://www.octave.org/bugs.html to learn how to write a helpful report).

For information about changes from previous versions, type `news'.

octave:1> figure
octave:2> tangyurou_img = imread('/home/sy/图片/BKG.jpg');  
octave:3> imshow(tangyurou_img)  
octave:4> tangyurou_info = imfinfo('/home/sy/图片/BKG.jpg')  
octave:5> 


上面的操作比较简单, 读取一张jpg格式的图片, 并显示出来。有图有真相:


tangyurou_info =
{
  Filename = /home/sy/图片/BKG.jpg
  FileSize =  201329
  Height =  900
  Width =  1440
  BitDepth =  8
  Format = JPEG
  LongFormat = Joint Photographic Experts Group JFIF format
  XResolution = 0
  YResolution = 0
  TotalColors =  162081
  TileName =
  AnimationDelay = 0
  AnimationIterations = 0
  ByteOrder = undefined
  Gamma = 0
  Matte = 0
  ModulusDepth =  8
  Quality =  75
  QuantizeColors =  256
  ResolutionUnits = undefined
  ColorType = truecolor
  View =
  FileModDate =  5- 6月-2011 23:11:12
}

好吧, 我承认, 我当时就震惊了。 本来还打算弄一个“Matlab for Linux”呢, 现在不用了(因为暂时还用不到那么多工具箱)。

再说Scilab

Scilab is a matrix-based scientific software package. Scilab contains hundreds of built-in mathematical functions, rich data structures (including polynomials, rationals,linear systems, lists, etc...) and comes with a number of specific toolboxes for control, signal processing, ...

This package also provides Xcos, a graphical editor to design hybrid dynamical systems models. Models can be designed, loaded, saved, compiled and simulated. Stable and efficient solution for industrial and academics needs, Xcos provides functionalities for modeling of mechanical systems (automotive, aeronautics...), hydraulic circuits (dam, pipe modeling...), control systems, etc. Modelica capabilities are also provided.

For a minimum version of scilab, install package "scilab-cli".
我下载的大概100多M。
画一个函数图形试试:

  ___________________________________________       
                     scilab-branch-5.3

                    Scilab协会 (DIGITEO)
              Copyright (c) 1989-2011 (INRIA)
                 版权所有 (c) 1989-2007 (ENPC)
        ___________________________________________       

开始执行:
  正在载入初始环境
-->close
-->clear
-->figure
 ans  =
Handle of type "Figure" with properties:
========================================
children: "Axes"
figure_position = [200,171]
figure_size = [622,597]
axes_size = [610,460]
auto_resize = "on"
viewport = [0,0]
figure_name = "图象窗口数目 %d"
figure_id = 0
info_message = ""
color_map= matrix 33x3
pixmap = "off"
pixel_drawing_mode = "copy"
anti_aliasing = "off"
immediate_drawing = "on"
background =  33
visible = "on"
rotation_style = "unary"
event_handler = ""
event_handler_enable = "off"
user_data = []
tag = ""
-->x = -10:0.01:10;
-->y = sin(x);
-->plot(x, y)
 警告: 由于你的设置限制,Scilab不能采用uicontrols和graph
      ics混合模式,输入"help usecanvas" 以获取更毒信息 




后记

今天下午另外一个收获就是学会在Ubuntu 11.04下创建桌面快捷方式了:

打开/usr/share/applications这个路径,这里有你所安装的所有程序的快捷方式图标,你只要复制到桌面就可以建立快捷方式了。



你可能感兴趣的:(MATLAB)