"We could probably solve the problem with a spreadsheet ...".
That comment, in a technically oriented email from a technically oriented person, prompted me to write (for other recipients of the email) the following text about my surprise that technical people use the `spreadsheet' type of program for solving any but a very small category of problem. It presumably can be done by a spreadsheet, but I'm often surprised by the industrial fondness for spreadsheets: a friend from industry explained it as being because `all our computers have one already, and matlab is very expensive'. Well, Matlab is absurdly expensive, but there are several very realistic Free (in the full sense) alternatives that provide an easy environment for writing programs in a high-level language with many useful functions, support for matrix and complex variables, plotting, file-access, etc. A few are described at the bottom of this page.
My bewilderment over the widespread use of spreadsheets is the following. If one had just a single `screenfull' of numbers from some accounts, and wanted to play with various input values to see how some others changed, then there would be some sense to using a spreadsheet. But if one wants to deal with anything where there are lots of constants, parameters and variables, and where one might want to have loops, breaks, etc., then surely it's much better in an environment where matrices and slices of these can be represented as meaningfully chosen variable-names, equations can be written in sequence in a simple syntax in a text file (rather than hidden in cells), and control structures such as while,for,if, etc. are natural. One can look at this program and see, about as clearly as if it were typeset maths, what it is going to do. If display of numbers is wanted, then Octave (or matlab, scilab, fortran, C) programs can print numbers to screen; or it can plot them in many ways. Even with these clear, sensibly written programs in high-level languages, we make plenty of silly mistakes that need debugging. How much worse it must be when in a hideously inappropriate format!
Likewise, using `calculator' on a computer screen for simple work is ridiculous compared to opening Octave and writing a single line of text then `Enter': with Octave there is history, so that previous (perhaps long) commands can be recalled and changed, and checks can be made on why an answer seemed wrong -- and this is quite apart from the ability to work with arrays, complex values etc.
So, I try to do my bit pointing out the alternatives: often it seems that much of the world is using something very unsuitable for the job, just because someone else was using it who'd found it on the computer when starting the job ... And let's not even get me on to the matter of suitability of `word processors' for the purposes of anything over one page long or involving maths!
Octave
has extremely matlab-compatible syntax (with
some desirable extensions). It is an available package in many
Linux-based or other Free-unix OSs, and an ms-windows version can
be got
here
as the last link (the MinGW one -- this should be a native version
rather than a Linux one running emulated within Cygwin).
There is good
documentation,
and a thorough
FAQ.
Octave's plotting uses gnuplot, which is by itself an excellent program for making screen and publication plots ... unfortunately, for some purposes, Octave calls gnuplot by sending text through a pipe, based on quite matlab-like plotting commands, which gives little scope for controlling gnuplot's many features and settings or for working interactively. One way of improving this would be to write results from Octave to a text file for calling as data from gnuplot; another is to dump the gnuplot text from Octave,
drawnow ("x11", "/dev/null", false, "output_file.gnuplot")then edit it before sending it to gnuplot. A program to intercept the data automatically would be good ...
Scilab does essentially the same things as Octave or Matlab, but without being fettered to maintaining compatibility with matlab: this may be seen as a blessing or a curse.
There are other technical computing environments that may be of use, many of them also Free software.
Matlab itself has some advantages over the Free programs in terms of highly interactive graphing abilities, more toolboxes (at huge cost), handy interaction with the editor, and features such as Simulink and a compiler.
Particularly if you're already `obliged' to have a licence (bought
higher up in your organisation), have a fast computer to cope with
the ludicrous weight of a sluggish Java-based GUI, and have an
employed admin to deal with the hassle of licensing and working
around various bugs (getting better, admittedly), this may be the
most efficient option.
Page started: 2008-09-20
Last change: 2010-09-27