Matlab Interview Question Answer
Matlab Interview Question Answer
Matlab Interview Question Answer
Synopsis
General
) What is MATLAB?
) What is the charter for the comp.soft-sys.matlab group?
) What commercially available MATLAB-type environments are sold?
) What non-commercial MATLAB-type environments exist?
) Are there any standards for MATLAB-type tools?
) How can I join a MATLAB user group?
) Are there any software archives?
) Are there any publications related to MATLAB?
MATLAB/SIMULINK Product Information
) How can I change the default window size, colors, etc. in MATLAB 4?
) How can I import MATLAB graphics into my Framemaker, TeX, etc. document?
) Is there a topical help function, like `apropos'?
) Why am I finding all these undocumented functions (like COMET) in MATLAB?
) Has anybody any information about the matlab function `system_dependent'?
) How can I get the parser to accept a dummy reference without an error?
) How do I get the plot command to cycle through line-types?
) Can I use `dbup' and `dbdown' within a function?
) Is there a GNU emacs editing mode for MATLAB?
) What is the sign convention used in MATLAB's FFT routines?
) Is there any MATLAB software for wavelets?
) Is there any MATLAB software for fuzzy logic?
) Is there any MATLAB software for communications?
) Is there a MATLAB interface to Mathematica?
) Why was `fsolve' removed from MATLAB Version 4?
) Are there any published books on, or relating to, MATLAB?
Quick Little MATLAB Hacks
) What is Xmath?
) Are there any publications related to MatrixX?
) Are there any e-mail addresses related to MatrixX/Xmath?
) What other modules are available from ISI?
Xmath User Questions
1) What is MATLAB?
MATLAB is the name used to refer to the class of matrix calculator environments derived from
the first, called MATLAB. MATLAB was developed by Cleve Moler in the late 1970s at the
University of New Mexico and other locations with support from the National Science
Foundation. Since then, many work-a-likes have been developed or are in development
commercially, in government and university labs, and so forth.
The name of the product available from MathWorks is "MATLAB", not Matlab, Pro-MatLab, etc.
Note that MathWorks holds a registered trademark on the uppercase version of MATLAB.
In this document, Matlab may refer to the collective set of MATLAB-based environments or it
may refer to the current implementation developed by MathWorks, Inc. In general, these
MATLAB-based environments are not source-language compatible.
The newsgroup 'comp.soft-sys.matlab' is a forum for discussing issues related to the use of
MATLAB, the scientific calculation and visualization package from MathWorks Inc. This includes
discussion of similar software packages which are also derived from the original `Classic
MATLAB', such as Xmath from Integrated Systems Inc.
Appropriate discussion in the group will include both general Matlab issues and platform-
specific questions, and discussion comparing MATLAB to other systems.
In alphabetical order:
246 Church Street, Suite 307 New Haven, CT 06510 Tel: 203-777-7442 Fax: 203-776-4074
`Ctrl-C' from Systems Control Technology, Inc.
CAE Systems Department 2300 Geng Road Palo Alto, CA 94303 Tel: 800-227-1910 Tel: 415-494-
2233 Fax: 415-496-6595
`MATLAB' from The MathWorks, Inc.
Cochituate Place 24 Prime Park Way Natick, MA 01760 Tel: 508-653-1415 Fax: 508-653-2997.
Email: info@mathworks.com
`O-MATRIX' from Harmonic Software, Inc.
12223 Dayton Avenue North Seattle, WA 98133 Tel: 206-367-8742 Fax: 206-367-1067 Email:
harmonic@world.std.com
`Xmath' from Integrated Systems, Inc.
3260 Jay St. Santa Clara, CA 95054-3309 Tel: (408) 980-1500 Fax: (408) 980-0400 Email: xmath-
info@isi.com
4) What non-commercial MATLAB-type environments exist?
In alphabetical order:
`Matcalc', by M.Gerberg and E.J. Moore, University of New South Wales, Australia. It is available
via anonymous ftp from
ftp.che.utexas.edu as /pub/octave/octave-?.?.tar.Z
`RLaB', written by Ian Searle (ians@eskimo.com), is free software (in the GNU copyleft sense). It
is currently available via anonymous ftp from
There is an IFAC/IEEE-CSS Working Group developing standards and guidelines for these tools. A
proposed standard command language was developed, is described in the document
"Command Language Standard for CACSD Software" and is available from
To join the user group, send your name, affiliation and address to:
matlab-users-request@mcs.anl.gov
For European user groups, contact:
France: Alain Baron phone: 33/1 45 34 23 91 fax: 33/1 45 07 08 06 Germany: Dr. Ingrid Bausch-
Gall phone: 49/89 323 2625 fax: 49/89 323 1063 Sweden: Svante Littmarck phone: 46/8 15 30
22 fax: 48/8 15 76 35 email: info@comsol.se
Switzerland: Carl Bergstrom phone: 031/961 70 11 fax: 031/961 12 82 email:
comsol@clients.switch.ch
Yes. MATLAB User Group software archive contains more than 1MB of user-contributed code.
This archive is located on NETLIB server of Oak Ridge National Laboratories. To learn more, send
following message:
Yes, Math Works Inc. publishes a quarterly magazine called MathWorks Newsletter, giving info.
on products (new versions, releases, toolboxes), matlab user group, matlab short courses,
related texts etc. To subscribe to the newsletter, send email with your snail mail address to
subscribe@mathworks.com.
* Object-based graphics facility * 3-D color scientific visualization abilities * Animation * Sound
output capability * M-file debugging facilities * Low-level file I/O functions * Graphical user
interface controls (GUI widget set) * Sparse matrix support * An improved help system *
Interpreter and graphics speed improvements * A new External Interface library (MEX-files,
engine, MAT-files) * Better documentation (in the eyes of the beholder, I imagine :-) ) * Lots of
other smaller improvements..
10) How does MATLAB perform on machine X?
The following list includes toolboxes currently offered by The MathWorks. For more info check
ftp.mathworks.com in /pub/product-info
Signal Processing Toolbox.
This is a toolbox for digital signal processing (time series analysis). It includes functions for the
design and analysis of digital filters, like Butterworth, Elliptic, and Parks-McClellan, and for FFT
analysis (power spectrum estimation). It also includes some 2-dimensional signal processing
capabilities.
This is a toolbox for control system design and analysis. It supports transfer function and state-
space forms (continuous/discrete time, frequency domain). Function for step, impulse, arbitrary
input responses, as well as Bode, Nyquist, and Nichols plots. Design with root-locus, pole-
placement, and LQR optimal control.
This is a toolbox for parametric modelling. Identified models are in transfer function form (either
z-transform or Laplace transform) and state-space form (e.g., ARMA models or Box-Jenkins
models).
Optimization Toolbox.
This is a toolbox for linear and nonlinear optimization and supports unconstrained and
constrained minimization, minimax, nonlinear least squares, multi-objective, and semi-infinite
optimization, linear programming, quadratic programming and the solution of non-linear
equations.
Spline Toolbox.
This is a toolbox for working with splines and is typically used for curve fitting, solution of
function equations and functional approximation.
Robust-Control Toolbox.
This is a toolbox for robust control system design and supports LQG/loop transfer recovery, H2,
H0, and mu- control synthesis, singular value frequency response, and model reduction.
Neural Net Toolbox.
This is a toolbox for designing and simulating neural networks and supports implementation of
the perceptron learning rule, the Widrow-Hoff rule, and several variations of the
backpropagation rule. Transfer functions included are hard limit, linear, logistic & hypertangent
sigmoid.
Delta Toolbox.
This is a toolbox for analysis using the delta transform, an approach to unifying continuous and
discrete systems theory without use of the Z-transform. It is available free to purchasers of
"Digital Control and Estimation: A Unified Approach," by Graham Goodwin and Rick Middleton.
The Image Processing Toolbox provides an environment for image processing and analysis.
Images are matrices (surprised?). Functions include linear and nonlinear filtering; image
restoration; image enhancement; image analysis and statistics; color, geometric, and
morphological operations 2-D transforms; and 2D FIR filter design and frequency response.
The Symbolic Math Toolbox contains functions for symbolic algebra, exact linear algebra,
variable precision arithmetic, equation solving, and special mathematical functions. Its
underlying computational engine is the kernel of Maple. The Extended Symbolic Math Toolbox
augments the functionality to include Maple programming features and specialized libraries.
Statistics Toolbox.
The Statistics Toolbox provides statistical data analysis, modeling, and Monte Carlo simulation;
building-blocks for creating your own special-purpose statistical tools; and GUI tools for
exploring fundamental concepts in statistics and probability. Functionality covers descriptive,
inferential, and graphical statistics, and linear models as well as interactive graphics for dynamic
visualization of functions, data, and probability distributions.
MATLAB's MEX-file facility allows user to use C and Fortran subroutines as MATLAB m-files. It is
also possible to use MATLAB as a computational engine for C/Fortran subroutines.
15) How can I change the default window size, colors, etc. in MATLAB 4?
from serr15@liverpool.ac.uk ...
The MATLAB (version 4) print command provides a "-deps" argument which provides a
Encapsulated PostScript file of your plot. Some people have reported various problems getting
this stuff to work. Some suggestions:
Use "bbps" and ghostscript. "bbps.shar" is available via anonymous ftp on "csi.jpl.nasa.gov".
You'll need to get GhostScript from your nearest GNU ftp site.
Yes. The function you're looking for is `lookfor' (in MATLAB 4).
>>
18) Why am I finding all these undocumented functions (like COMET) in MATLAB?
Almost everything in the "demos" directory is not described in the User's Guide. There are lots
of goodies there. In 4.0, the demos are best place to see examples of Handle Graphics.
There are other undocumented functions in directories other than demos. Some of them are
"worker" functions that are unlikely to be used directly; they are simply called by other
functions. A few, like COMET and COMET3, were actually written after the User's Guide had
been sent to the printer.19) Has anybody any information about the matlab function
`system_dependent'?
`system_dependent' is an unpublished function that is used for a variety of crufty things. It will
most certainly change from time to time and possible even go away completely. For anybody
curious about it, here is what it does in MATLAB 4.0 on SPARCstations:
system_dependent(1) deals with the MATLAB-ACSL interface. ACSL is a simulation language that
MATLAB can talk to. See ACSL.M for more information.
system_dependent(2,0) turns off command-line editing. system_dependent(2,1) turns it back
on.
system_dependent(3) is unused.
system_dependent(4,i,j) is used to program the command-line editing keys. See CEDIT.M for
more information.
system_dependent(5) enables core dumps in the event of seg faults. Normally MATLAB tries to
catch seg faults and "continue".
20) How can I get the parser to accept a dummy reference without an error?
MATLAB parses code to look for syntax errors. When the parser encounters a name with 2 or
fewer arguments, it lets them pass since they might be a variable with indices. If it encounters a
name with 3 or more arguments, MATLAB knows it cannot be a variable, so the error message is
returned. If you don't want the parser to snag the function, specify one with 2 or fewer
arguments.
MATLAB v4.1 has a an axis property LineStyleOrder for this. Monochrome users can tell MATLAB
to always use white lines and cycle through their favorite line styles with the commands:
MATLAB wasn't designed to be used this way. But, if you don't reference any variables between
your calls to `dbup' and `dbdown' (i.e., you just use `save', `who', `dir', etc), it should work.
Otherwise, you may well run into problems. If you `dbup' while in a function, you change the
workspace context while continuing execution of the original function. This means that
subsequent references to variables will be bound to variables in a different workspace. Since the
internal p-code uses integers as variable identifiers, you will get a random attachment to these
different variables. At best, you'll get random results. At worst you might seg fault if you exceed
the number of available identifiers.
csi.jpl.nasa.gov as pub/matlab/util/matlab-mode.el
24) What is the sign convention used in MATLAB's FFT routines?
The FFT in MATLAB is defined as sum(x(i)*exp(-j*i*k/N)) and not sum(x(i)*exp(j*i*k/N)). The first
version is traditionally used by engineers, the second version by mathematicians. Since MATLAB
was written by an engineer (John Little), the engineering approach was used.
Contact Carl Taswell is working on a wavelet toolbox. The toolbox and associated papers are
available via anonymous ftp from
simplicity.stanford.edu in /pub/taswell
A newer version should be available soon.
Also, Jeff Kantor is distributing a wavelet toolbox. It is available via anonymous ftp from
control.cheg.nd.edu in /pub/wavelets/wavetools1_1.tar
The toolbox, rice-wlet-tools-1.1, a collection of MATLAB "mfiles" and "mex" files for twoband
and M-band filter bank/wavelet analysis, is available via anonymous ftp from
cml.rice.edu in /pub/dsp/{software,papers}
Contact Ramesh Gopinath .
A.Lotfi has developed a Fuzzy Inference Systems Toolbox. It is available via anonymous ftp from
ftp.mathworks.com as /pub/contrib/misc/fuzzy_inference_systems.sh or
/pub/contrib/misc/pc_fuzzy_inference_systems.sh
A Fuzzy-Control Toolbox has been developed by Bernhard Kaemmpf . Send him email if you are
interested in obtaining the software. (Sounds like he is willing to give it away.)
Jyh-Shing Roger Jang has provided a few routines for demonstrating parameterizing
membership functions (MF) and learning in fuzzy inference systems (FIS). The file fuzzdemo.tar.Z
is available via anonymous ftp from
csi.jpl.nasa.gov in /pub/matlab/contrib/
27) Is there any MATLAB software for communications?
Mehmet Zeytinoglu has written a MATLAB toolbox for communications. It is available via
anonymous ftp from
ftp.mathworks.com as /pub/contrib/misc/comm_tbx.tar
28) Is there a MATLAB interface to Mathematica?
Yes. WRI has developed a free MATLAB-Mathematica interface. It is available via anonymous ftp
from
The algorithms used by fsolve were not numerically well behaved. MathWorks did not feel that
it met the standards require for approved software. The version of FSOLVE in the Optimization
Toolbox is recommended. If your site doesn't still have the 3.5 version, you can get it via
anonymous ftp from
ftp.mathworks.com as /pub/contrib/optim/fsolve35.tar
30) Are there any published books on, or relating to, MATLAB?
csi.jpl.nasa.gov as /pub/matlab/matlab-books
Quick Little MATLAB Hacks
To initialize a matrix with values "a" in the first row and values "b" in the second row, do the
following:
[a(1,ones(1,m)) ; b(1,ones(1,m))]
32) How can I load-from or save-to a file whose name is in a string variable?
You can in MATLAB 4. The following hack is from Laura Needles and Mike Kantner . Define the
script file `mkglobal.m', containing
global mkglobal_var
Define the script file `mkglobal_2.m' as
MATLAB on the PC
35) What can I do when MATLAB tells me there is not enough environment space?
This usually happens if in the matlab path you include greater that 4 or 5 paths. One solution is
to increase your environment space by adding the following command in your config.sys file:
shell=c:\\dos\\command.com /e:nnnnn /p
where nnnnn is the number of bytes you use for environment memory. It varies from 256 bytes
to 32768 bytes(32Kbytes). Usually, 5000 bytes can solve your problem. (The /p command is used
so that the autoexec.bat file runs when you boot your computer.)
From the UNIX/Shell environment, type: ftp isi.com (if the host is unknown, try ftp 192.73.222.1)
When asked for name/user, type: anonymous When asked for the password, simply type your e-
mail address.
Once your e-mail address is accepted, and if the maximum number of ftp clients has not been
exceeded, the connection will be made and a list of instructions will appear. Simply follow that
list of instructions to transfer a copy of Xmath to your system.
Yes, ISI publishes a quarterly magazine called Response Times that gives information on
products (new ver- sions, releases, modules), user conference, classes, and a Technical Support
Corner where they answer user questions.
Also, ISI has an annual Users Conference. The viewgraph presentations from this conference are
available. The next conference in March 15-17, 1993.
* support@isi.com tech support for ISI MatrixX products (408)980-1590 ext. 321 * info@isi.com
product literature requests * kate@isi.com contributions to Response Times Mag
39) What other modules are available from ISI?
Xmath does not currently allow you to 'derive' new subclasses from the built-in ones (dynamic
systems, parameter-dependent matrices, strings and string matrices, polynomials, "special
matrices", etc.) However, a number of our users have used the list object to create compound
objects containing different kinds of built-in objects, then used the resulting list-based object for
more complex data modeling. Your question echoes a request we've heard a number of times
and is a high priority for our future development, so keep an eye out. . .