Friday, September 14, 2012

LOVE MATLAB


MATLAB

MATrix LABoratory is a high level language with interactive environment developed by MathWorks. It was designed to aid numerical computation, visualization and application development. It also allows matrix manipulations, plotting of functions and data, and interfacing with programs written in other languages like C, C++, Java and Fortran. One can write programs and develop algorithms faster than traditional languages.

Key Features
  • Interactive environment for iterative exploration, design, and problem solving 
  • Mathematical functions for linear algebra, statistics, Fourier analysis, filtering, optimization, numerical integration, and solving ordinary differential equations 
  • Built-in graphics for visualizing data and tools for creating custom plots 
  • Tools for building applications with custom graphical interfaces


NUMERIC COMPUTATIONS (Methods)

  • Interpolation and regression 
  • Differentiation and integration 
  • Linear systems of equation 
  • Fourier analysis 
  • Eigenvalues and singular values 
  • Ordinary differential equations (ODEs) 
  • Sparse matrices


DATA ANALYSIS AND COMPUTATIONS

  • Acquiring Data: Accessing through files, other applications, databases and external devices (e.g. Microsoft Excel, image, sound, video files)
  • Analyzing Data: Manage, filter, and preprocess your data. Add-on products provide capabilities for curve and surface fitting, multivariate statistics, spectral analysis, image analysis, system identification, and other analysis tasks
  • Visualizing Data: MATLAB provides built-in 2-D and 3-D plotting functions; Plots can be customized either interactively or programmatically. 
MATLAB Plot Gallery

  • Documenting and Sharing Results: Automatically generates a report when you execute a MATLAB program. The report contains your code, comments, and program results, including plots. Reports can be published in a variety of formats, such as HTML, PDF, Word, or LaTeX.


PROGRAMMING AND ALGORITHM DEVELOPMENT
MATLAB provides features of traditional programming languages, including flow control, error handling, and object-oriented programming (OOP). You can use fundamental data types or advanced data structures, or you can define custom data types.

Development Tools: MATLAB includes a variety of tools for efficient algorithm development including: 
  • Command Window - Lets you interactively enter data, execute commands and programs, and display result 
  • MATLAB Editor - Provides editing and debugging features, such as setting breakpoints and stepping through individual lines of code 
  • Code Analyzer - Automatically checks code for problems and recommends modifications to maximize performance and maintainability 
  • MATLAB Profiler - Measures performance of MATLAB programs and identifies areas of code to modify for improvement 

APPLICATION DEVELOPMENT AND DEPLOYMENT

Designing Graphical User Interface: Using GUIDE (Graphical User Interface Development Environment), you can lay out, design, and edit custom graphical user interfaces. You can include common controls such as list boxes, pull-down menus, and push buttons, as well as MATLAB plots. Graphical user interfaces can also be created programmatically using MATLAB functions.


WHO'S WHO?

Cleve Barry Moler

Cleve Moler is the chief mathematician, chairman, and cofounder of MathWorks. He received his bachelor's degree from Caltech in 1961 and Ph.D. from Stanford University. He is the chairman of the computer science department at the University of Mexico when he started developing MatLab in the 1970s. His design of MatLab is intended to give his students access to LINPACK and EISPACK without them having to learn Fortran.



According to Moler, his creation of MatLab was very primitive, written in Fortran and was hardly even a programming language. He acknowledged Jack Little’s involvement in giving a promising debut to MatLab. He added, as he is the Father of MatLab Little is the real heart and soul and the basis for the success of the company, MathWorks.



John (Jack) Little

Jack Little is the president and one of the founders of MathWorks. He holds a bachelors degree in Electrical Engineering and Computer Science from Massachusetts Institute of Technology (1978) and also receive his Master’s degree from Stanford University (1980).

In 1979 Little was first exposed to MatLab during a visit of Cleve Moler to Stanford University. He heard about MATLAB from some friends that took Moler’s course. Realizing the helpful use of MatLab in engineering he then joined Moler and his friend Steve Bangert in rewriting MatLab in C and founding MathWorks in 1984.

HISTORY

The history of MATLAB starts in the early 1970s, with the development of two libraries of FORTRAN mathematical subroutines in the mid-1970s under a grant from the National Science Foundation. These two libraries were called LINPACK and EISPACK.

LINPACK was written by Jack Dongarra, Jim Bunch, Cleve Moler, and Pete Stewart.

 Jim Bunch                                 Jack Dongarra                               Pete Stewart

In order to make these packages easier for students to use, Moler created MATLAB, whose name is a contraction of "Matrix Laboratory."

The original MATLAB was a FORTRAN program designed for the era of timesharing and ASCII terminals. It had only one data type (the matrix of complex doubles) and a fixed collection of 80 functions. Moler used the FORTRAN MATLAB in teaching numerical analysis at Stanford in 1979.

Word of the program reached Jack Little, who grasped the potential of MATLAB in signal processing and control, and the possibility of making a successful software product based on MATLAB for the new IBM PC.

Jack Little and Steve Bangert developed PC MATLAB by porting Moler's code from FORTRAN to C, adding user-defined functions (in effect making MATLAB into a programming language rather than a calculator), improved graphics, and libraries of MATLAB routines, the toolboxes. Moler, Little, and Bangert formed the Mathworks in 1984, with PC MATLAB as the first product. Their first sale was an order for ten copies placed by Professor Nick Trefethen at MIT.

There have been several major revisions and enhancements to MATLAB, including an extended set of graphics tools and primitives, multidimensional arrays and lists (known in MATLAB as cell arrays), classes and objects, economical storage schemes and algorithms for sparse matrices, a debugger, a profiler, a GUI builder, a lower cost student edition, and Just-In-Time (JIT) compilation for improved performance. The computational core has been upgraded through the incorporation LAPACK (a state-of-the-art library for matrix computation), as well as software for computation of definite integrals, integration of ordinary differential equations, and root finders. Toolboxes created by the Mathworks and other contributors have expanded the scope of MATLAB, adding capabilities in areas such as optimization, signal and image processing, fuzzy logic, splines, wavelets, statistics, partial differential equations, bioinformatics, and mathematical finance. SIMULINK, an extensible block diagram environment for simulation and model-based design appeared as a second Mathworks product in 1990.





The Mathworks logo is a picture (generated by MATLAB) of a numerical approximation to the fundamental mode of a vibrating L-shaped membrane, a topic that Moler discussed in his Stanford Ph.D. thesis in 1965.





ACCESSING MATLAB


1 By default, MATLAB console looks like this (with file browser and command history):

2 To use MatLab without console, use –nojvm flag.

3 Matlab can be run in background. For long running labs, there are 2 options.

          a Under csh,

matlab < matlab.in >& matlab.out &

          b Under bash, 

matlab < matlab.in > matlab.out 2>&1 &

Note: Redirecting error messages are critical and cannot be retrieved.

MATLAB BASICS


SYMBOL/ COMMANDS
FUNCTIONS/DESCRIPTION
%
 comment character
Variable Name
 maximum of 63 characters
Three periods (…)
 usually at the end of the line
 allows continuation
;
 terminates displaying of output in the input line
ans
 default object storage
 holds the current object value until the next statement is executed
help (text)
helpwin (separate window)
doc (browser)
lookfor (apropos)
 available help is accessible by using this

Remarks
     1 Use single quotes, not double quotes.
     2 Emacs-style editing is always available at the command line.


SAMPLE CODE

% HELLO is a simple script to say “Hello, world!”
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    26 January 2007
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'HELLO:\n' );
  fprintf ( 1, '  MATLAB version\n' );
  fprintf ( 1, '  This is how to say:\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Hello, world!\n' );

  quit


>> hello_run
HELLO_RUN will run the "hello.m" M file.
Hello, world!
Elapsed time is 0.024424 seconds.
HELLO_RUN: Normal end of execution.
>> 

Some insights

"Pros"

“At the time, I was still convinced that C was the way to go, so the first advanced item I learned how to do was to use the MEX interface. I eventually realized the error of my ways and slowly began to learn about vectorization and logical indexing through the resident MATLAB guru in my group, and the rest is history! I’m now convinced that MATLAB is one of the best and most accessible programming paradigms in existence for scientific computing.”

-Bryant Tran (Cody Champion)

 "MATLAB is the language of choice for people doing mathematical development".

-Randy Allen, Chief Executive Officer of Catalytic (Palo Alto, Calif.)

Members

Emirrah said, "MATLAB? It's simply AMAZING."
Briar said, "."
Leira said, "One got to love MATLAB because of its fantastic features. In our CMSC150 class, I am so fascinated with how Maxima manipulates such numerical computations. But with what MATLAB has to offer, everything will be easier especially on computing. Furthermore, it is interactive at its finest. I hope UPLB-ICS will use MATLAB in the near future."
Tricia said, "MATLAB is exceptionally a complete programming language at its own field. It has everything any numerical computing has to offer. It is interactive. However it will consume very large chunks of your computer memory. Then again, space has to suffer for wholeness.”

Sources

http://www.mathworks.com/products/matlab/

Brought to you by

lotlotandfriends CMSC 124 T-1L
Dogelio, Emirrah Hazelle
Nuestro, Briar Rose B. 2010-11820
Panol, Maria Leira P.
Posadas, Tricia Joy R.

8 comments: