Matlab—A Tool for Doing Numerics
The first time I heard about Matlab was when DOS 3.3 was popular and my dad received a demo version on his PC. I played around with it a bit, but soon lost interest because there was no manual and I did not have any real use for it.
The second encounter was about three years ago when I attended a lecture on numerical mathematics. Some of the exercises the students had to hand in were intended to be solved with Matlab. There was even a handout describing the basic functions of the program. As is usually the case with exercises, numerical homework tends to be very time-consuming, so again I did not spend much time on it. Soon thereafter, I installed Linux on my then new PC.
The third time I came into contact with Matlab was during my diploma thesis. All serious data evaluation in the group where I worked was done using Matlab—not on UNIX, but on a Macintosh.
I asked whether I could bring my until-then “unplugged” Linux box to the lab and network it. I got an IP number and a weekend later the first Linux computer of our group was up and running.
Campus licenses are available for various software and I was quite happy to find Mathematica, Maple and Matlab for Linux. Shortly afterwards, I was running the already-existing Mac-Matlab scripts on my computer.
Matlab is a command-line-driven program specializing in all types of matrix manipulation. Everything in Matlab is expressed using matrices; even a scalar can be thought of as a 1x1 matrix.
The first noncommercial version of Matlab was based on LINPACK and EISPACK routines. Since then, much has changed and Matlab is now one of the fastest packages available for numerical computation.
When Matlab is started in an xterm, a prompt appears after a brief display of the logo in a separate window. Basic editing is possible, though the spoiled Linux user might miss tab completion. (A sophisticated tab-completion feature recognizing file names would be great.)
A nice feature of Matlab is the ability to cluster data into compounds similar to structs in C, but it is not necessary to define them in advance. One simply adds fields to a variable, i.e., data.Temp might be the temperature at which a measurement was taken, and data.B is a vector containing the values of the magnetic field at which the Hall resistivities data.rxy were measured. Adding a string data.date='July-4th-1999' is not a problem, either. Going a step further, it is even possible to use object-oriented features.
For complex tasks involving more than two or three commands, one can write scripts or functions. The difference between them is that scripts are executed as if they were typed at the command prompt, whereas functions use private memory with local and global variables, and of course, can have multiple return values. The syntax loosely follows C and makes scripting relatively straightforward.
It is even possible to implement graphical front ends for your Matlab application with all different kinds of buttons, sliders and levers, as shown in Figure 1.
The interface used in the Linux version is extremely simple compared to the Windows or Macintosh version. No editor is provided for scripting, so the user has to stick to Emacs or some other editor. I personally use XEmacs in Matlab mode with syntax highlighting. The mode was written by Matt Wette and can be found at ftp.alumni.caltech.edu/pub/mwette/matlab.el. As far as I know, there is even a mode for GNU Emacs which makes it possible to run a Matlab session within the Emacs window.
Debugging scripts is not nearly as comfortable as in the Windows or Macintosh environment, where the editor windows have buttons for running the script stepwise. Instead, debugging has to be done by issuing commands for setting breakpoints, etc., on the command line. Mathworks could make big improvements by adding, for example, a window with Step In/Over/Out buttons with a display showing the next command and offering the option of adding breakpoints.
In my opinion, it should be rather straightforward to implement this in Tcl/Tk with the script sending the specific command to the command line. An inspection window for variables would also be a neat feature, one that, to my knowledge, does not even exist on other platforms.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- ServersCheck's Thermal Imaging Camera Sensor
- The Italian Army Switches to LibreOffice
- Linux Mint 18
- Petros Koutoupis' RapidDisk
- Oracle vs. Google: Round 2
- The FBI and the Mozilla Foundation Lock Horns over Known Security Hole
- Privacy and the New Math
- Ben Rady's Serverless Single Page Apps (The Pragmatic Programmers)
Until recently, IBM’s Power Platform was looked upon as being the system that hosted IBM’s flavor of UNIX and proprietary operating system called IBM i. These servers often are found in medium-size businesses running ERP, CRM and financials for on-premise customers. By enabling the Power platform to run the Linux OS, IBM now has positioned Power to be the platform of choice for those already running Linux that are facing scalability issues, especially customers looking at analytics, big data or cloud computing.
￼Running Linux on IBM’s Power hardware offers some obvious benefits, including improved processing speed and memory bandwidth, inherent security, and simpler deployment and management. But if you look beyond the impressive architecture, you’ll also find an open ecosystem that has given rise to a strong, innovative community, as well as an inventory of system and network management applications that really help leverage the benefits offered by running Linux on Power.Get the Guide