
Antennas and Microwaves

Matlab and alternatives from an MS Windows viewpoint.
Original post 2008, last updated Feb 2010
CONTENTS
Almost every scientist or engineer will at some point need to do a little number crunching that requires a bit more than a calculator or an Excel spreadsheet. Matlab has undoubtedly become the standard by which others are judged, if only because of the number of other packages that purport to emulate it or be an equal to it.
I have used Matlab in a professional environment for around 12 years and found it
to be an excellent tool. As its name suggests the unit of operation is a matrix,
with which you can do just about anything, then plot the result in just about any
form. However, the real power of Matlab is in its architecture, using the famous
m-
Apart from being able to operate Matlab directly from the command line, sequences
of instructions can be stored in files with a “.m” extension. Once the file is saved
you just tell Matlab which directory to find it in, your m-
To run the file you just type the name at the command prompt, or you can use it
in another m-
It all sounds incredibly easy, and it is, which is why Matlab has become so popular. At the end of the day all languages are going to have their little idiosyncrasies regarding command syntax. What sets one apart from another is how easy it is to get those commands doing something useful for you.
So, having sung Matlab’s praises, why look for alternatives? The answer for me is
cost and accessibility. Using Matlab is great if you only want to share the end results
of your work. Trying to share m-
I would prefer to be able to write small utility programs that can run on something that is freely available on the web. However, the chosen platform needs to get at least close to Matlab in the ease of use department – no one likes a pain in the arse, even if it’s free!
Here is a list of some of the qualities I’ve been looking for:
Here are the packages I’ve looked at so far. I cannot claim to have used them all in real anger, but that is partly due to shortcomings in some of the categories listed above. I haven’t included links to the sites, just type the name into Google, the home site is almost certainly on the first page.
Well there seem to be huge numbers of references to sources for the download, and the home site promises good things. On the up side there was a single self extracting installer, on the down side the resulting installation did nothing apart from briefly display a logo. (I tried on Win XP / 98 & 95). As a result it failed the “ease of installation test”. A trawl of the web using search strings such as “jmathlib forum” now reveals that I am not the only one who has had difficulties. It appears that the Windows installer puts all the necessary bits on your computer but then it’s very much up to you to get the Java to run. Unless you’ve had some experience of setting up Java and writing scripts, you are probably going to end up looking for the haemorrhoid cream with this one.
The last time I tried this I was looking for something that would still run on Win98,
the version I found was v2.1.50 which installed easily on Win98 and XP. Apart from
a few difficulties with calling up Notepad (the default text editor), the main difficulties
I saw for the Windows user centred around the very non-
Moving on to v3.2.3, there has obviously been a lot of development going on in terms
of the internals, the installation now takes up a whopping 359MB of disk space. This
rather precluded any more experiments on my Win98 based machine so this evaluation
is limited to use with XP. The installation is now very Windows-
Looking through the installation directory (the default is C:\Octave) the folders
are now much better organised and the documentation is easier to locate (C:\Octave\3.2.3_gcc-
Octave uses m-
Matlab files running on Octave
After my limited experimentation I would have to say that Octave has now reached
a point where simple m-
Octave files running on Matlab
Since Octave could be loosely regarded as a subset of the Matlab language, writing
m-
Bearing in mind the Mathworks is unlikely to just halt development of Matlab and
wait for Octave to catch up, there is never likely to be true compatibility between
the two. However, I think the point has arrived where there is sufficient similarity
between core functions that it is possible to write simple m-
This is a very polished product that immediately gives the impression it has been written for Windows. Although the installation worked on Win XP, 98 and 95, it was only really happy running under Win XP. This is fair enough since the only platforms that are claimed to be supported are XP and 2000.
The user interface is very tidy including an integrated editor/debug, a path tool
to add new search paths and an online help. The standard header-
On starting for the first time you will need to add the search paths to the standard
toolboxes (io, funfun etc). Using the pathtool ‘add with subfolders’ option add C:\Program
Files\ FreeMat\toolbox and then re-
In terms of I/O, there are the standard C based commands for reading/writing to file and there is also system command support, so Windows “.exe” files can be called from within Freemat. There is mention in the documentation of commands to link low level code directly into Freemat. So there is the possibility in future, of 3rd parties developing integrated GPIB or DAQ toolboxes. In the mean time a suitable data capture program could be run externally and the data retrieved from a temporary file.
Out of all the packages I have looked at, this one is the closest to a Matlab clone. It unashamedly aims to copy the best features of Matlab and hopefully improve on it in other areas. In this respect it scores well in terms of being able to share files. There are obviously going to be differences and omissions between Matlab and Freemat, but GUI’s and very high level functions aside, basic number crunching and plotting routines should run on either with minimal changes.
The last time I looked at Freemat (v 3.6) the graphics output was the main issue,
it was very slow and let the rest of the package down. The graphics in v4.0 are much
improved, graphs plot in a timely fashion, the default scaling is better and more
of the handle graphics options are available. As with Octave, Freemat is basically
a subset of Matlab, so it is going to be easier to write m-
Once installed Freemat v4.0 takes up around 57MB of diskspace, which seems quite modest by today’s standards. I know this is not very scientific but I always prefer software whose size is commensurate with what it does. So if you are looking for a compact Matlab clone with a good Windows style user interface, Freemat could well be the answer.
This product has a very well supported host site and is being developed in very professional
fashion, with defined goals, roadmaps and time scales. Versions 2.x / 3.x / 4.x and
the latest 5.x are available for download. I have downloaded and installed versions
2,3 and 4 – all installed and ran without problem on Win95, 98 and XP. I have not
tried 5.x due to my 56K connection (we are in very rural France) and version 5 is
76MB. The only thing to watch if you are using an older machine is hard-
From a Matlab user’s point of view the main difference between Matlab and Scilab is the fundamental architecture. Scilab is much more like a traditional programming language such as C; functions and macros are not the same things. While a macro can be run by simply executing it (although even this requires the command “exec” not just the name of the macro), functions have to be loaded into Scilab and compiled before they can be run or referenced by a macro.
This is not really a problem if all the function definitions reside at the beginning
of your macro. However, in the interests of a modular or function based approach
it is easier to have functions stored as separate files. Ideally, once all your new
functions are finished, they will be available as a complete library on start-
Making a library that is available on start-
While none of the above steps is particularly arduous on its own, and the end result
would be a very well organised extension to the language library, I cannot help feeling
that it is all a bit fiddly and a long way from the Matlab approach i.e. Copy all
your m-
I find this lack of functionality a little surprising since an awful lot of effort
has been put into another feature of Scilab, a Matlab to Scilab translator. This
attempts not only to convert the syntax of the Matlab commands but the actual program
flow as m-
Aside:
I personally think that the Scilab developers have missed the main point about what
makes a high level language (E.g. Matlab) attractive to a wide variety of users.
It is about ease of operation and communication between users. There is no need to
change the fundamental way Scilab operates, just provide the option of a fast-
Now I am no applications developer, but I cannot imagine it would be too hard to
make user written content easier to include by adding a few extra commands.
For example: mhelp myfunction -
mexec mymacro -
mgetf myfunction -
Plus a Matlab/Freemat style pathtool to add searchable paths for user defined functions.
Looking past the architectural details of Scilab, the graphical user interface (GUI)
itself is very easy to use and intuitive on all versions. Later versions have an
integrated editor and a very good cross-
In addition to the standard number crunching libraries there is Scicos, a Simulink equivalent, except this one is provided free. System I/O commands are supported and work well, including running of external programs. User contributions include toolboxes for GPIB and DAQ interfacing, third party reports seem to suggest that they work well.
For Individual Products
Jmathlib, I couldn’t get this to run, so I can’t really say much more than that. If the installer goes to the trouble of putting a shortcut icon on the desktop, I think it should just work, and it doesn’t.
Octave may well be an excellent tool on a Unix platform, but even the latest version
cannot hide its command line origins. That said, it is now so close to Matlab functionally
that it must be considered a strong candidate, especially if you want to write m-
Freemat looks good cosmetically, works well functionally, and with the graphics improvements
in v4.0 it has really come together as a package. Progress from here will largely
depend on whether a good user base starts to emerge. Not having an academic heritage
and echoes of Unix has resulted in a much more Windows-
Scilab is a very good piece of numerical modelling software in its own right. As such I think it should probably go its own way and not try too hard to follow Matlab. The architectures are just different and they both have their advantages. I think the overheads of Scilab requiring a more traditional program structure are balanced by the flexibility you gain from the lower level commands.
Overall
If I had to choose a freely available number crunching package for my own personal
use it would have to be Scilab, simply because “it does what it says on the tin”.
Even if the operating instructions are little harder to follow, the user-
For a package to write small utility programs to share with other people, I would
choose Freemat over Scilab. This is because if you type “Matlab files .m” into Google
you find that there are thousands and thousands of m-

Matlab Alternatives
