Thursday, August 25, 2011

| By: Ashraff

Matlab

MATLAB is a high-level language and interactive environment that enables you to perform computationally intensive tasks faster than with traditional programming languages such as C, C++, and Fortran. 
You can use MATLAB in a wide range of applications, including signal and image processing, communications, control design, test and measurement, financial modeling and analysis, and computational biology. Add-on toolboxes (collections of special-purpose MATLAB functions, available separately) extend the MATLAB environment to solve particular classes of problems in these application areas.
MATLAB provides a number of features for documenting and sharing your work. You can integrate your MATLAB code with other languages and applications, and distribute your MATLAB algorithms and applications.


History

Cleve Moler, the chairman of the computer-science department at the University of New Mexico, started developing MATLAB in the late 1970s.[3] He designed it to give his students access to LINPACK and EISPACK without their having to learn Fortran. It soon spread to other universities and found a strong audience within the applied mathematics community. Jack Little, an engineer, was exposed to it during a visit Moler made to Stanford University in 1983. Recognizing its commercial potential, he joined with Moler and Steve Bangert. They rewrote MATLAB in C and founded MathWorks in 1984 to continue its development. These rewritten libraries were known as JACKPAC.[4] In 2000, MATLAB was rewritten to use a newer set of libraries for matrix manipulation, LAPACK.[5]
MATLAB was first adopted by researchers and practitioners in control engineering, Little's specialty, but quickly spread to many other domains. It is now also used in education, in particular the teaching of linear algebra and numerical analysis, and is popular amongst scientists involved in image processing.[3] However, many researchers mostly from Computer Science background feel that MATLAB should be used only for mathematical analysis necessary in image processing and not for implementation of image processing software. Moreover, MATLAB should not be used to simulate computer architectures, systems software and computer networks unless while solving some numeric problem.

Key Features

  • High-level language for technical computing
  • Development environment for managing code, files, and data
  • Interactive tools for iterative exploration, design, and problem solving
  • Mathematical functions for linear algebra, statistics, Fourier analysis, filtering, optimization, and numerical integration
  • 2-D and 3-D graphics functions for visualizing data
  • Tools for building custom graphical user interfaces
  • Functions for integrating MATLAB based algorithms with external applications and languages, such as C, C++, Fortran, Java, COM, and Microsoft Excel. 
ml_environment 7155


Developing Algorithms and Applications

MATLAB® provides a high-level language and development tools that let you quickly develop and analyze your algorithms and applications.

The MATLAB® Language

The MATLAB® language supports the vector and matrix operations that are fundamental to engineering and scientific problems. It enables fast development and execution.

With the MATLAB language, you can program and develop algorithms faster than with traditional languages because you do not need to perform low-level administrative tasks, such as declaring variables, specifying data types, and allocating memory. In many cases, MATLAB eliminates the need for ‘for’ loops. As a result, one line of MATLAB code can often replace several lines of C or C++ code.

At the same time, MATLAB provides all the features of a traditional programming language, including arithmetic operators, flow control, data structures, data types, object-oriented programming (OOP), and debugging features.

ml_commodulation
A communications modulation algorithm that generates 1,024 random bits, performs modulation, adds complex Gaussian noise, and plots the result--all in just 9 lines of MATLAB code.
MATLAB lets you execute commands or groups of commands one at a time, without compiling and linking, enabling you to quickly iterate to the optimal solution.
For fast execution of heavy matrix and vector computations, MATLAB uses processor-optimized libraries. For general-purpose scalar computations, MATLAB generates machine-code instructions using its JIT (Just-In-Time) compilation technology.

This technology, which is available on most platforms, provides execution speeds that rival those of traditional programming languages.

Development Tools

MATLAB includes development tools that help you implement your algorithm efficiently. These include the following:

MATLAB Editor - Provides standard editing and debugging features, such as setting breakpoints and single stepping

M-Lint Code Checker - Analyzes your code and recommends changes to improve its performance and maintainability

MATLAB Profiler - Records the time spent executing each line of code

Directory Reports - Scan all the files in a directory and report on code efficiency, file differences, file dependencies, and code coverage

ml_m-lintcodechecker
An M-Lint Code Checker report that includes recommendations for making the code faster and easier to maintain.

Designing Graphical User Interfaces

You can use the interactive tool GUIDE (Graphical User Interface Development Environment) to lay out, design, and edit user interfaces. GUIDE lets you include list boxes, pull-down menus, push buttons, radio buttons, and sliders, as well as MATLAB plots and ActiveX controls. Alternatively, you can create GUIs programmatically using MATLAB functions.

ml_guidelayout
GUIDE layout of a wavelet analysis GUI (top) together with the completed interface (bottom).


Analyzing and Accessing Data

MATLAB® supports the entire data analysis process, from acquiring data from external devices and databases, through preprocessing, visualization, and numerical analysis, to producing presentation-quality output.

Data Analysis

The MATLAB product provides interactive tools and command-line functions for data analysis operations, including:
  • Interpolating and decimating
  • Extracting sections of data, scaling, and averaging
  • Thresholding and smoothing
  • Correlation, Fourier analysis, and filtering
  • 1-D peak, valley, and zero finding
  • Basic statistics and curve fitting
  • Matrix analysis
ml_atmosphereplot 7159
Plot showing curve fitted to the monthly averaged atmospheric pressure differences between Easter Island and Darwin, Australia.

Data Access

MATLAB is an efficient platform for accessing data from files, other applications, databases, and external devices. You can read data from popular file formats, such as Microsoft Excel; ASCII text or binary files; image, sound, and video files; and scientific files, such as HDF and HDF5. Low-level binary file I/O functions let you work with data files in any format. Additional functions let you read data from Web pages and XML.

You can call other applications and languages, such as C, C++, COM objects, DLLs, Java, Fortran, and Microsoft Excel, and access FTP sites and Web services. Using the Database Toolbox™, you can also access data from ODBC/JDBC-compliant databases.

You can acquire data from hardware devices, such as your computer‘s serial port or sound card. Using the Data Acquisition Toolbox™ , you can stream live, measured data directly into MATLAB for analysis and visualization. The Instrument Control Toolbox™ (available separately) enables communication with GPIB and VXI hardware.

ml_hdfdata
HDF data from a satellite, selected and imported into MATLAB using the MATLAB HDF Import Tool.

Visualizing Data

All the graphics features that are required to visualize engineering and scientific data are available in MATLAB®. These include 2-D and 3-D plotting functions, 3-D volume visualization functions, tools for interactively creating plots, and the ability to export results to all popular graphics formats. You can customize plots by adding multiple axes; changing line colors and markers; adding annotation, LaTEX equations, and legends; and drawing shapes.

2-D Plotting

You can visualize vectors of data with 2-D plotting functions that create:
  • Line, area, bar, and pie charts
  • Direction and velocity plots
  • Histograms
  • Polygons and surfaces
  • Scatter/bubble plots
  • Animations
ml_lineplotemissions
Line plots of multiple engine emission test results, with a curve fitted to the raw data.

3-D Plotting and Volume Visualization

The MATLAB product provides functions for visualizing 2-D matrices, 3-D scalar, and 3-D vector data. You can use these functions to visualize and understand large, often complex, multidimensional data. You can specify plot characteristics, such as camera viewing angle, perspective, lighting effect, light source locations, and transparency. 3-D plotting functions include:
  • Surface, contour, and mesh
  • Image plots
  • Cone, slice, stream, and isosurface
ml_buckyball
A 3-D isosurface plot revealing the geodesic dome structure of a carbon-60 fullerene molecule.

Creating and Editing Plots Interactively

MATLAB provides interactive tools for designing and modifying graphics. From a MATLAB figure window, you can perform the following tasks:
  • Drag and drop new data sets onto the figure
  • Change the properties of any object on the figure
  • Zoom, rotate, pan, and change camera angle and lighting
  • Add annotations and data tips
  • Draw shapes
  • Generate a function that can be reused with different data
ml_graphs
A collection of graphs, constructed interactively by dragging data sets onto the plot window, creating new subplots, changing properties such as colors and fonts, and adding annotation.

Importing and Exporting Graphic Files

MATLAB lets you read and write common graphical and data file formats, such as GIF, JPEG, BMP, EPS, TIFF, PNG, HDF, AVI, and PCX. As a result, you can export MATLAB plots to other applications, such as Microsoft Word and Microsoft PowerPoint, or to desktop publishing software. Before exporting, you can create and apply style templates, covering characteristics such as layout, font, and line thickness, to meet publication specifications.

Performing Numeric Computation

MATLAB® contains mathematical, statistical, and engineering functions to support all common engineering and science operations. These functions, developed by experts in mathematics, are the foundation of the MATLAB language. The core math functions use the LAPACK and BLAS linear algebra subroutine libraries and the FFTW Discrete Fourier Transform library. Because these processor-dependent libraries are optimized to the different platforms that MATLAB supports, they execute faster than the equivalent C or C++ code.

MATLAB provides the following types of functions for performing mathematical operations and analyzing data:

  • Matrix manipulation and linear algebra
  • Polynomials and interpolation
  • Fourier analysis and filtering
  • Data analysis and statistics
  • Optimization and numerical integration
  • Ordinary differential equations (ODEs)
  • Partial differential equations (PDEs)
  • Sparse matrix operations
MATLAB can perform arithmetic on a wide range of data types, including doubles, singles, and integers.

Add-on toolboxes (available separately) provide specialized mathematical computing functions for areas including signal processing, optimization, statistics, symbolic math, partial differential equation solving, and curve fitting.

ml_gammafunction
Plot showing the complex valued gamma function on the complex plane, where the height of the surface is the modulus, or absolute value, and the contour lines are modulus and phase.


ml_atanfunctiongui
Plot of complex function atan(z). Contour lines for the real and imaginary parts are superimposed on a color image showing magnitude and phase.


Publishing Results and Deploying Applications

MATLAB® provides a number of features for documenting and sharing your work. You can integrate your MATLAB code with other languages and applications and deploy your MATLAB algorithms and applications as stand-alone programs or software modules.

Publishing Results

The MATLAB product lets you export your results as plots or as complete reports. You can export plots to all popular graphics file formats and then import the plots into other packages, such as Microsoft Word or Microsoft PowerPoint. Using the MATLAB Editor, you can automatically publish your MATLAB code in HTML, Word, LaTEX, and other formats.

ml_htmlpublish
MATLAB program (left) published to HTML (right) using the MATLAB Editor. Results output to the command window or to plots are captured and included, and the comments are turned into section headings and body text in the HTML.
To create more complex reports, such as simulation runs and multiple parameter tests, you can use the MATLAB Report Generator (available separately).

Integrating MATLAB Code with Other Languages and Applications

MATLAB provides functions for integrating C and C++ code, Fortran code, COM objects, and Java code with your applications. You can call DLLs, Java classes, and ActiveX controls. Using the MATLAB engine library, you can also call MATLAB from C, C++, or Fortran code.

Deploying Applications

You can create your algorithm in MATLAB and distribute it to other MATLAB users directly as MATLAB code. Using the MATLAB Compiler (available separately), you can deploy your algorithm, as a stand-alone application or as a software module that you include in your project, to users who do not have MATLAB.

Additional products let you convert your algorithm into a software module that is callable from COM or Microsoft Excel.

ml_helicopterapp
Helicopter sound identification application, deployed and running outside MATLAB. The application, developed in MATLAB, directly acquires signals from measurement hardware, performs analysis and plotting, and includes GUI controls.








For more details and downloads of MATLAB, visit:


For MATLAB tutorials, visit:

0 comments:

^ Go to Top