Table of Contents:

· 1. General Questions

o 1.1. General Information

§ 1.1.1. What is MATLAB?

§ 1.1.2. What is SIMULINK?

§ 1.1.3. On what machines is MATLAB available?

§ 1.1.4. What was first: the company MathWorks or the product MATLAB?

§ 1.1.5. What is the history of MATLAB?

§ 1.1.6. What is the charter for the USENET Newsgroup comp.soft-sys.matlab?

§ 1.1.7. Are there any software archives?

§ 1.1.8. Are there any publications related to MATLAB?

§ 1.1.9. What toolboxes are currently available from The MathWorks?

§ 1.1.10. How do I contact The MathWorks about MATLAB via email?

o 1.2. Product Information

§ 1.2.1. What's new in MATLAB 4.2?

§ 1.2.2. When will MATLAB 4.2 be released on the various platforms?

§ 1.2.3. How does MATLAB perform on machine X?

§ 1.2.4. What's new with SIMULINK?

§ 1.2.5. What's new in Signal Processing Toolbox version 3.0?

§ 1.2.6. What's new in Neural Network Toolbox version 2.0?

§ 1.2.7. Can a C or FORTRAN subroutine be called directly from MATLAB?

§ 1.2.8. Can I call MATLAB routines from my C or FORTRAN programs?

§ 1.2.9. Is there going to be a 4.0 version of the Student Edition?

§ 1.2.10. Is there a MATLAB compiler?

o 1.3. User Questions

§ 1.3.1. General MATLAB Questions

§ 1.3.1.1. How do I import graphics into other applications?

§ 1.3.1.2. How do I run MATLAB in the background under UNIX? MS Windows?

§ 1.3.1.3. Why doesn't MATLAB run as fast as I expect it to?

§ 1.3.1.4. How can I change the default window size, colors, etc., in MATLAB?

§ 1.3.1.5. How do I manipulate colormaps?

§ 1.3.1.6. Is there a topical help function, like 'apropos'?

§ 1.3.1.7. How can I get information about undocumented functions (like comet) in MATLAB?

§ 1.3.1.8. How does the Random generator work?

§ 1.3.1.9. Is there a Pseudo-Random Binary Sequence (PRBS) generator in MATLAB?

§ 1.3.1.10. What is the numeric precision of MATLAB?

§ 1.3.1.11. How do I run MATLAB in batch mode?

§ 1.3.2. Matrices

§ 1.3.2.1. What is the largest matrix MATLAB can handle?

§ 1.3.2.2. How does MATLAB index its matrices?

§ 1.3.2.3. Can MATLAB handle multidimensional arrays?

§ 1.3.2.4. How can I initialize a low rank matrix easily?

§ 1.3.3. Functions

§ 1.3.3.1. Why, when I edit a function file in MATLAB, is the change not seen by MATLAB until everything is cleared or MATLAB is restarted?

§ 1.3.3.2. How can I get the parser to accept a dummy reference without an error?

§ 1.3.3.3. Is there a GNU emacs editing mode for MATLAB?

§ 1.3.3.4. Does MATLAB have a debugger?

§ 1.3.4. eval Command

§ 1.3.4.1. How does the eval command work?

§ 1.3.4.2. How can I use a filename that is a variable as an input argument to the load, save, and print functions?

§ 1.3.5. MATLAB Functions

§ 1.3.5.1. Why was fsolve removed from MATLAB Version 4?

§ 1.3.5.2. What is griddata? How do I use it to contour irregularly spaced data?

§ 1.3.5.3. What is the sign convention used in MATLAB's fft routines?

§ 1.3.5.4. How do I fit a curve in MATLAB?

§ 1.3.6. File I/O

§ 1.3.6.1. How do I use fread, fwrite, and fprintf?

§ 1.3.6.2. How can I store the result of ls *.dat in a variable?

§ 1.3.7. Differential Equations

§ 1.3.7.1. Can MATLAB solve Ordinary Differential Equations (ODE)?

§ 1.3.7.2. How do I pass in extra parameters to ode and quad?

§ 1.3.7.3. How do I do double integration in MATLAB?

§ 1.3.8. Memory

§ 1.3.8.1. What can I do when MATLAB tells me I'm out of memory?

§ 1.3.9. Student Edition

§ 1.3.9.1. Why does my Student Edition hang my machine after the MATLAB banner is displayed?

§ 1.3.9.2. How do I print using the Student Edition?

· 2. Graphics

o 2.1. Using get and set

§ 2.1.1. What is a handle?

§ 2.1.2. How do I use get and set?

§ 2.1.3. What properties can I control?

§ 2.1.4. How do I change the default settings for an object's properties?

§ 2.1.5. How do I change the default settings back to their original settings?

o 2.2. Properties of the Figure and the Axes

§ 2.2.1. Fonts

§ 2.2.1.1. How do I change the font of text objects?

§ 2.2.1.2. How do I change the font of tick labels?

§ 2.2.1.3. How do I get Greek letters in my text objects?

§ 2.2.1.4. Can I have multiple fonts in one text object?

§ 2.2.2. Lines

§ 2.2.2.1. How do I change the line width?

§ 2.2.2.2. How do I change the line style order on printouts?

§ 2.2.2.3. How do I cycle through the line color order?

§ 2.2.3. Positions

§ 2.2.3.1. How do I change the size and position of my figure window?

§ 2.2.3.2. How do I define an invisible axis?

§ 2.2.3.3. Which units should I use?

o 2.3. Background Color

§ 2.3.1. How do I invert the background on my printout?

§ 2.3.2. How do I change my background for plots?

o 2.4. Using MATLAB Graphs with Other Packages

§ 2.4.1. Can graphics be saved as files to be imported back into MATLAB for viewing and alteration?

§ 2.4.2. Can I edit MATLAB graphs in other applications?

§ 2.4.3. How do I copy and paste MATLAB graphs to the clipboard?

o 2.5. Graphical User Interface (GUI)

§ 2.5.1. How do I make a dialog box?

§ 2.5.2. How do CallBacks work? What is the best way to write a CallBack?

§ 2.5.3. Where do CallBacks get executed?

o 2.6. Miscellaneous

§ 2.6.1. Why does waterfall return a blank screen?

§ 2.6.2. How do you get perspective with 3-D plots?

§ 2.6.3. Why does MATLAB sometimes draw patches out of order?

§ 2.6.4. How do I use multiple colormaps?

§ 2.6.5. What is the difference between pcolor and image?

· 3. Printing

o 3.1. General

§ 3.1.1. How do I print in MATLAB?

§ 3.1.2. How do I print a SIMULINK block diagram?

o 3.2. GhostScript

§ 3.2.1. What is GhostScript? How do I use it?

§ 3.2.2. Where can I get documentation for GhostScript?

§ 3.2.3. Why would I print with a GhostScript device?

§ 3.2.4. What do I do if my printer isn't listed among the GhostScript devices?

§ 3.2.5. How do you use GhostScript to display PostScript files to the screen from DOS?

o 3.3. Printing to a File

§ 3.3.1. How do I print to a file?

§ 3.3.2. How do I know what option to use?

§ 3.3.3. How do I print out an HPGL format file?

o 3.4. SIMULINK Printing

§ 3.4.1. How do I change fonts in SIMULINK?

§ 3.4.2. What do I do if I am getting SIMULINK blocks and no text?

§ 3.4.3. How do I print my SIMULINK diagram on more than one page?

§ 3.4.4. How do I print a SIMULINK model from within an M-file?

o 3.5. Common Problems

§ 3.5.1. Why does my printer hang when I try to print from the pulldown menu?

§ 3.5.2. Why, after a long session of MATLAB under MS Windows where many figures printed, do I start to have a problem printing?

§ 3.5.3. Why don't my axis labels print correctly?

§ 3.5.4. Why can't I print broken lines?

§ 3.5.5. Why can't I print UI controls?

§ 3.5.6. Why, when I use interpolated shading or print surfaces, does my graph look "blocky" when the graph looked fine on the screen?

§ 3.5.7. What do I do if my PC beeps and hangs when I try to print?

· 4. License Manager

o 4.1. Installing MATLAB

§ 4.1.1. Are there step by step instructions for installation?

§ 4.1.2. When should I run lmdebug?

§ 4.1.3. When do I have to run the license manager?

o 4.2. License Configurations

§ 4.2.1. How do I set up the license manager so that it runs on a heterogeneous network?

§ 4.2.2. On a UNIX network, how do I run a back-up server configuration?

§ 4.2.3. How do I combine license.dat files if I am running another vendor that uses FlexLM?

§ 4.2.4. How do I run two versions of MATLAB on a VAX?

o 4.3. Common Error Messages:

§ 4.3.1. Cannot Connect to License Server

§ 4.3.2. XXX Feature is not Currently Licensed

§ 4.3.3. Environment Variable of lm_license_file Not Defined

§ 4.3.4. No TCP License Server Exists

§ 4.3.5. Invalid Returned Data From License Server

§ 4.3.6. License Server Does Not Support This Feature

§ 4.3.7. Unable to Read License File

· 5. SIMULINK/MEX-Files/Engine

o 5.1. SIMULINK

§ 5.1.1. Printing SIMULINK models

§ 5.1.1.1. How do I print my SIMULINK model?

§ 5.1.1.2. Why doesn't the text on my SIMULINK diagram print out?

§ 5.1.2. MATLAB Function block

§ 5.1.2.1. Why can't I call any MATLAB function from the MATLAB Function block?

§ 5.1.2.2. What is the difference between the MATLAB Function block and the function block?

§ 5.1.3. General Questions

§ 5.1.3.1. How do I mask SIMULINK blocks?

§ 5.1.3.2. Why doesn't linmod return the correct results?

§ 5.1.3.3. Can SIMULINK handle complex signals?

§ 5.1.3.4. How do I use the set_param and get_param functions?

§ 5.1.4. S-functions

§ 5.1.4.1. What is the flag ordering for S-functions?

§ 5.1.4.2. How do I display values numerically, rather than graphically (with the scope)?

§ 5.1.4.3. Are there any examples of S-functions in C? FORTRAN?

o 5.2. MEX-Files and Engine

§ 5.2.1. Compilers we support

§ 5.2.2. MEX-File function examples

§ 5.2.2.1. Where can I get C MEX-file function examples?

§ 5.2.2.2. Are there any FORTRAN MEX-file examples?

§ 5.2.2.3. How do I write a C++ MEX-file function?

§ 5.2.2.4. Are there any engine examples?

§ 5.2.3. Common Problems

§ 5.2.3.1. Why an I getting a segmentation violation error?


1. General Questions

1.1. General Information

1.1.1. What is MATLAB?

MATLAB was originally developed to be a "matrix laboratory," written to provide easy access to matrix software developed by the LINPACK and EISPACK projects. Since then, the software has evolved into an interactive system and programming language for general scientific and technical computation and visualization. The basic MATLAB data element is a matrix. MATLAB commands are expressed n a form very similar to that used in mathematics and engineering. For instance, b = A x, where A, b, and x are matrices, is written b = A * x . To solve for x in terms of A and b, write x = A\b . There is no need to program matrix operations explicitly like multiplication or inversion. Solving problems in MATLAB is, therefore, generally much quicker than programming in a high-level language such as C or FORTRAN. There are hundreds of built-in functions that come with the basic MATLAB and there are optional "toolboxes" of functions for specific purposes such as Controls, Signal Processing, and Optimization. Most of the functions in MATLAB and the Toolboxes are written in the MATLAB language and the source code is readable. There are two basic versions of the software, the professional version, and the student edition. The student edition is distributed by Prentice-Hall, the professional version is distributed by The MathWorks, Inc. Send an email to or call 508-65-pi (508-653-1415) for more information.

1.1.2. What is SIMULINK?

SIMULINK is an interactive system for the nonlinear simulation of dynamic systems. It is a graphical, mouse-driven program that allows systems to be modeled by drawing a block diagram on the screen. It can handle linear, nonlinear, continuous-time, discrete-time, multivariable, and multirate systems. SIMULINK runs on workstations using X-Windows, under Microsoft Windows on the PC, and on the Macintosh. It takes full advantage of windowing technology, including pull-down windows and mouse interactions. SIMULINK is fully integrated with MATLAB, and, together with MATLAB and the Control System Toolbox, forms a complete control system design and analysis environment.

1.1.3. On what machines is MATLAB available?

MATLAB is available on machines ranging from the PC to the Cray. The list includes PC, Macintosh, and NEC personal computers, Sun, DEC, HP, IBM, and SGI workstations, VAX minicomputers, and Convex and Cray supercomputers.

1.1.4. What was first: the company MathWorks or the product MATLAB?

MATLAB was first. The MathWorks, Inc. was founded in 1984 to develop and market MATLAB.

1.1.5. What is the history of MATLAB?

In the mid-1970s, Cleve Moler and several colleagues developed the FORTRAN subroutine libraries called LINPACK and EISPACK under a grant from the National Science Foundation. LINPACK is a collection of FORTRAN subroutines for solving linear equations, while EISPACK contains subroutines for solving eigenvalue problems. Together, LINPACK and EISPACK represent the state of the art software for matrix computation. In the late 1970s, Cleve, who was then chairman of the computer science department at the University of New Mexico, wanted to be able to teach students in his linear algebra courses using the LINPACK and EISPACK software. However, he didn't want them to have to program in FORTRAN, because this wasn't the purpose of the course. So, as a "hobby" on his own time, he started to write a program that would provide simple interactive access to LINPACK and EISPACK. He named his program MATLAB, for MATrix LABoratory. Over the next several years, when Cleve would visit another university to give a talk, or as a visiting professor, he would end up by leaving a copy of his MATLAB on the university machines. Within a year or two, MATLAB started to catch on by word of mouth within the applied math community as a "cult" phenomena. In early 19