📄 octaveinfo.html
字号:
<html><head><title>Octave</title></head><body bgcolor="#ffffff" vlink="#ff0000", marginwidth="20", marginheight="20"><h2>Octave</h2>MATLAB is great, but it is expensive. GNU Octave is a veryviable alternative. Octave runs under Linux, Windows and Mac OS X. <p> With the release of Octave 3 many of the remainingincompatibilities between Octave and MATLAB have been eliminated andthe graphics much improved. Plotting and image display is not as fastor as polished as it is under MATLAB but you can do pretty welleverything you want to. Most of your MATLAB code will run underOctave with no modifications required.<p> You will also find that Octave has a number of features that areimprovements on MATLAB. For example you can create stand-aloneexecutable scripts, you can write sin(x)(1:10); rather than y =sin(x); y = y([1:10]); and you can specify default argument values forfunctions, to name a few.<!--In recent times the Octave project has become increasingly activeand a number of toolboxes, including an image processing toolbox, arebeing built up. I have been impressed to find that many of myfunctions run under Octave with little or no modification. Most ofthe changes needed are due to the fact that plotting and visualizationof data under Octave are not as well developed as they are underMATLAB. As far as image processing is concerned the major difficultyis the inability to overlay plots on an image. Functions with noplotting, or simple plotting commands, will often run with no change.--><p>The installation of Octave is straightforward and the installation ofpackages (Octave's equivalent of MATLAB toolboxes) has beenstreamlined. <p> I suggest you check the following links<ul> <li><a href=http://www.octave.org>The Octave home page</a> Download Octave and get documentation here. <li><a href=http://octave.sourceforge.net/>GNU Octave-Forge Package Repository</a> Get your packages (toolboxes) here. I suggest you start with the image, signal, optim, plot and miscellaneous packages. <!-- <li><a href=http://wiki.octave.org/wiki.pl?CategoryScriptArchive>The OctaveScript Archive</a> <li><a href=http://hpc.sourceforge.net/>HPC Mac OS X</a> A great pageof Mac OS X numerical software. Here you will find an easilyinstalled Octave binary for the Mac. This is what I use.--></ul><p>Please do not mail me about any Octave installation problems, Iwill not know how to help you. You should refer to the appropriate FAQpages.<h3>A few gotchas to look out for</h3><ul><li> imwrite under Octave has its arguments reversed relative to MATLAB<pre> > imwrite(filename, image) % Octave > imwrite(image, filename) % MATLAB</pre>However the Octave imwrite function now detects if the arguments are in'MATLAB order' and swaps them for you so you do not need to worry about this.<li>Display of colour images can be washed out. This seems to becaused by the rgb colormap having only 64 entries. If I create a 256element colormap images are displayed fine. At least this is what Ifind with my Mac OSX installation. <li> Some image processing toolbox functions test the input imageagainst the function <tt>isgray</tt> which, if your data is of typedouble, only returns true if all values lie in the range [0 1]. Ifyou get an error message saying your gray scale image is not a grayscale image you probably need to rescale its values to [0 1].<li>I have found on odd occasions (that I have difficulty replicating)that the SVD in 'economy' mode can sometimes be too economical and Ilose a dimension in the decomposed matrices.<li>The use of 'private' subdirectories does not seem to be supported.You can, of course, explicitly add the private subdirectory to yourPATH assuming name clashes are not a problem.<li>Subfunctions within a file do not seem to over-ride publicfunctions of the same name. Note this is also a problem in MATLABwhen the public function happens to be a built-in function. </ul><h3>Notes on code modifications to provide Octave compatibility</h3>In a few cases I have had to create slightly different execution pathsfor Octave and MATLAB. To detect whether the code is running underOctave I am using the following test (thanks to Rosen Diankov for this).<pre> Octave = exist('OCTAVE_VERSION') ~= 0;</pre><p>While MATLAB allows one to pass string arguments to functions withoutenclosing quotes and brackets, for example<pre> warning off axis equal</pre>this is not (always) allowed under Octave. However, by writing code in theproper functional form such as<pre> warning('off'); axis('equal')</pre> compatibility under both MATLAB and Octave can be maintained. With Octave 3 this problem is mostly eliminated. <hr><h3>Historical Stuff</h3><!--<h3>Some additional functions to allow execution under Octave </h3>--> With the earier versions of Octave there was a bit of fiddling around required to get things to work. I wrote a number of functions to allow execution of my code under Octave. With Octave 3 they are no longer needed. Listed below are a few of these functions, you may possibly want the placeholder functions. <ul> <li><a href=OctaveCode/fspecial.m>fspecial.m</a> replacement for MATLAB fspecial. Note the current image package now has an implementation of fspecial (which incorporates some of this code). This link is just here for historical reference. <li><a href=OctaveCode/truesize.m>truesize.m</a> Placeholder function that does nothing except allow code written for MATLAB handle-graphics to at least execute under Octave. <li><a href=OctaveCode/pixval.m>pixval.m</a> Placeholder <li><a href=OctaveCode/rotate3d.m>rotate3d.m</a> Placeholder <!-- <li><a href=OctaveCode/line.m>line.m</a> Minimal implementation of MATLAB's LINE function using PLOT. This is needed for a number of functions. <li><a href=OctaveCode/show.m>show.m</a> Minimal implementation of SHOW so that code that uses my MATLAB function SHOW will at least still execute under Octave. <li><a href=OctaveCode/set.m>set.m</a> Placeholder function that does nothing except allow code written for MATLAB handle-graphics to at least execute under Octave. <li><a href=OctaveCode/get.m>get.m</a> Placeholder <li><a href=OctaveCode/shading.m>shading.m</a> Placeholder <li><a href=OctaveCode/box.m>box.m</a> Placeholder --> </ul> </body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -