Specifications

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 tradi-
tional 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.
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 ReportsScan all the files in a
directory and report on code efficiency, file dif-
ferences, file dependencies, and code coverage
% Generate a
vector of N bits
N = 1024;
Bits = rand(N,1)>0.5;
% Convert to symbols
Tx = 1-2*Bits;
% Add white Gaussian noise
P = 0.4;
Nz = P*(randn(N,1)+i*randn(N,1));
Rx = Tx + Nz;
% Display constellation
plot(Rx,’.’);
axis([-2 2 -2 2]);
axis square, grid;
-2 -1 0 1
2
2
1.5
1
0.5
0
-0.5
-1
-1.5
-2
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.
An M-Lint Code Checker
report that includes recom-
mendations for making the
code faster and easier to
maintain.