MATLAB 5.2 Product Family New Features | Search  Help Desk |
find
uisetcolor
(UNIX)
Upgrades to Simulink, Real-Time Workshop, Toolboxes, and Blocksets
MATLAB 5.1 completed the upgrades to the entire set of toolboxes. The Fixed-Point Blockset 1.0.2 was introduced with MATLAB 5.1. New releases of the following products were also produced with MATLAB 5.1; however, these products have been upgraded once again for MATLAB 5.2 (the MATLAB 5.2 version number is shown, since that is the version that is shipped with MATLAB 5.2):Language and Development Environment Enhancements
Thefind
function returns an empty matrix if nothing is found. Previously it returned [0,1
].
On the PC and Macintosh, MATLAB 5.1 added support for multibyte characters (including Kanji) for data.
This feature allows you to use multibyte characters in MATLAB strings. You can also use multibyte characters in Handle Graphics property values and Simulink blocks.
Note that you cannot use multibyte characters in variable, file, or function names. Also, multibyte text may not be machine independent.
Removal of Microsoft Windows TCP/IP Issues
Notebook Support for Office 97
format
command.
The Path Browser on the Macintosh
Handle Graphics Enhancements
MATLAB 5.1 provided some new Handle Graphics functions. MATLAB added two new functions,scatter
and scatter3
, which enable you to create two-dimensional and three-dimensional scatter plots. Each function allows you to specify the style, size, and color of the marks used to create the scatter diagrams.
See the online MATLAB Function Reference for more information about these functions.
X-Windows Support for uisetcolor
Theuisetcolor
function is supported on X-Windows systems (UNIX).
Previously Undocumented Functions
These two functions existed in MATLAB 5.0, with command line help, but were not documented in the MATLAB 5.0 online Function Reference; they are documented in the MATLAB 5.2 online Function Reference:pagedlg
- Dialog box to set page layout properties for printing Figures.
printdlg
- Dialog box to manage printing of Figures.
TIFF and JPEG Device Drivers
MATLAB 5.1 added new built-in device drivers for producing TIFF (Tagged Image File Format) and JPEG (Joint Photographic Experts Group) graphics files from MATLAB figures. These drivers are available on all platforms. This table summarizes the command-line switches for these drivers:print
command.
To produce a TIFF file from a MATLAB figure, use the -dtiff
switch. For example, this command produces a TIFF file named newplot.tif
from the current figure:
print -dtiff newplot.tifYou can use the
-r
option in conjunction with the -dtiff
switch to specify the resolution of the output. For example:
print -dtiff -r100 newplot.tifIf you do not specify the resolution, MATLAB uses the default resolution of 150 dots per inch. Note that you must specify a filename because TIFF files cannot be sent directly to a printer. If you omit the filename, MATLAB assigns the file a name, such as
figure1.tif
. If you specify a filename that does not include the .tif
extension, MATLAB appends the extension automatically.
The TIFF files that MATLAB produces are 24-bit truecolor bitmaps. MATLAB renders these graphics using the Z-buffer renderer, regardless of the setting of the figure Renderer
property. If you use the -painters
switch with the print
command, the switch is ignored.
The TIFF output produced by -dtiff
uses packbit compression, a lossless compression scheme that is supported by virtually all applications that can import TIFF graphics. If you need to import a TIFF file into an application that does not read packbit-compressed TIFF, use the -dtiffnocompression
switch to produce an uncompressed TIFF file. (You can abbreviate this switch to -dtiffn
.) For example:
print -dtiffn -r100 newplot.tifAn uncompressed TIFF file is often much larger than the same file compressed. For certain plots, the uncompressed file may be more than 10 times the size of the compressed file. (The actual ratio will vary. The size of an uncompressed file depends only on the resolution and the width and height values in the
PaperPosition
figure property; the size of the compressed file also depends on the content of the figure.)
To produce a JPEG file from a MATLAB figure, use the -djpeg
switch. For example, this command produces a JPEG file named newplot.jpg
from the current figure:
print -djpeg newplot.jpgYou can you use the
-r
option in conjunction with the -djpeg
switch to specify the resolution of the output. For example:
print -djpeg -r100 newplot.jpgIf you do not specify the resolution, MATLAB uses the default resolution of 150 dots per inch. Note that you must specify a filename because JPEG files cannot be sent directly to a printer. If you omit the filename, MATLAB assigns the file a name such as
figure1.jpg
. If you specify a filename that does not include the .jpg
extension, MATLAB appends the extension automatically.
The JPEG files that MATLAB produces are 24-bit truecolor bitmaps. MATLAB renders these graphics using the Z-buffer renderer, regardless of the setting of the figure Renderer
property. If you use the -painters
switch with the print
command, the switch is ignored.
JPEG files use a lossy compression scheme that compresses files dramatically with relatively little loss of information. This scheme enables you to make tradeoffs between file size and quality, by specifying a quality level between 0 (minimum quality, maximum compression) and 100 (maximum quality, minimum compression). By default, -djpeg
uses a quality level of 75; however, you can use a different level by appending the value to the device name. For example, this command produces a JPEG file with a quality level of 50:
print -djpeg50 -r100 newplot.jpgEven at the highest quality level, JPEG files are often highly compressed. In fact, depending on the figure, a JPEG file with a quality level of 100 may be considerably smaller than a packbit-compressed TIFF file of the same figure.
TIFF Preview Images for Encapsulated PostScript
MATLAB 5.1 introduced support for TIFF preview images for Encapsulated PostScript (EPS) files. To produce a TIFF preview, use the-tiff
switch. For example, this command creates an EPS file called newplot.eps
that contains a TIFF preview:
print -deps -tiff newplot.epsThe preview image has a resolution of 72 dots per inch, and the colors in the preview match the colors in the EPS file. MATLAB creates the EPS with a loose bounding box (i.e., white space around the figure), so that the size and position of the preview image match the EPS. There may be some differences between the EPS and the TIFF preview because the preview is always rendered using Z-buffer, while the EPS may be rendered with painter's algorithm. The
-tiff
switch works on all platforms; you can view the resulting preview image within any application that can display TIFF graphics.
Alternate Method on the Macintosh
On Macintosh systems, you can also specify a TIFF preview image by selecting Save As from the File menu of the figure window. In the dialog box, use the File Type pop-up menu to select an EPS format, and then select TIFF from the Preview pop-up menu. Also on Macintosh systems, if you use theprint
command to create an EPS file and you do not use the -tiff
switch, the file is created with a PICT preview. On other platforms, no preview is created.
API Enhancements for Windows NT
Setting Up the Compiler Location
MATLAB 5.1 provided a new switch for themex
script. The switch, setup
, allows you to configure the default options file, mexopts.bat
, for your system C compiler. This eliminates the need to reinstall MATLAB if you change compilers for your environment.
You can run the setup
option from either the MATLAB or DOS command prompt, and it can be called anytime to configure the options file.
Executing the setup
option presents a list of compilers whose options files are currently shipped in the bin
subdirectory of MATLAB. This example shows how to select the Microsoft Visual C++ compiler:
C:\mex -setup C compilers [1] Microsoft Visual C++ [2] Borland C/C++ [3] Watcom C/C++ Fortran compilers [4] Microsoft Powerstation [0] None compiler: 1If the selected compiler has more than one options file (due to more than one version of the compiler), you are asked for a specific version. For example,
Which version [1] 4.x [2] 5.x version: 1Finally, you are asked to enter the location of your compiler:
Please enter the location of your C compiler c:\msdev
API Enhancements for Macintosh
Installation Notes for Using CodeWarrior 11 with the MATLAB API
MATLAB 5.1 introduced support for CodeWarrior 10. CodeWarrior 11 is supported with the limitations described below. Previous versions of CodeWarrior are not supported. In CodeWarrior 11, Metrowerks introduced a new ANSI C library, known as the Metrowerks Standard Library (MSL). Based on difficulties involved in upgrading to MSL, and from similar USENET reports of MSL bugs, MATLAB Application Program Interface (API) support for MSL has been postponed until a future version of CodeWarrior is released. To use CodeWarrior 11 to generate MEX-files and/or MAT applications, you must install the old CodeWarrior libraries and header files. These files are the same as those shipped with previous versions of CodeWarrior, and can be found on the CodeWarrior 11 CD-ROM in the folderCW11 Gold Tools:Metrowerks CodeWarrior:(Obsolete ANSI Libraries):The names of the folders within
(Obsolete ANSI Libraries)
indicate the CodeWarrior folder to which their contents should be copied.
Using CodeWarrior 10 and 11 with the MATLAB API
The instructions below supersede the instructions for building MAT-file programs when using CodeWarrior 10 and 11 that are given in Chapter 4 of the MATLAB Application Program Interface Guide.Building Applications on the Power Macintosh and 68K Macintosh
To build applications that use the MAT-file API, start with a project made from the stationeryMATLAB_API_App.PPC.proj
(for Power Macintoshes) or MATLAB_API_App.68k.proj
(for 68K Macintoshes) in the <MATLAB>:extern:src:
folder. Then, make these modifications to your project:
.User
field the folder
<MATLAB>:extern:include:
.
.libmx
and
libmat
from the <MATLAB>extern:lib:PowerMac:
libmx.lib
, libmi.lib
,
libut.lib
, and libmat.lib
from the
<MATLAB>:extern:lib:68k:Metrowerks:
folder to the project.
Stateflow
Addition to the Simulink Modeling Environment
Stateflow was introduced with MATLAB 5.1 adding to the Simulink modeling and simulation environment. A graphical tool for designing complex control and supervisory logic systems, Stateflow allows you to model and simulate the behavior of complex reactive, event-based systems based on finite state machine theory. Stateflow lets you add event-driven elements of a system to Simulink continuous or discrete modeling for a single, closed-loop simulation. Stateflow represents an evolution from finite state machine theory by adding several major improvements, including hierarchy, parallelism, junctions, and history. These changes enable Stateflow to make practical use of finite state machine theory with realistic application to control systems. A major benefit of Stateflow is its seamless point-and-click interface to Simulink. The control behavior that Stateflow models provides an ideal complement to the algorithmic behavior modeled in Simulink. In Simulink, you develop your model of continuous- and discrete-time dynamic systems using its graphical, block diagram environment. Then you drag and drop the blocks that represent Stateflow diagrams directly into your Simulink model to add event-driven behavior to Simulink simulations. Applications for Stateflow include developing the control logic in embedded systems for electronic and mechanical systems found in automobiles, aircraft, telecommunications systems, computer peripherals, office automation equipment, and medical instrumentation. Stateflow works with the latest versions of Simulink and Real-Time Workshop to offer an integrated environment for modeling, simulating, and prototyping real-time embedded systems applications. Stateflow provides automatic C-code generation through the optional Stateflow Coder. C code generated by Stateflow Coder can be used independently or integrated with code from Real-Time Workshop. Thus, Simulink, Stateflow, and Real-Time Workshop are integrated from the design and modeling phase through the code generation stage. The generated code can be executed for rapid prototyping, hardware-in-the-loop testing, or for stand-alone simulations.Mapping Toolbox
The Mapping Toolbox was introduced with MATLAB 5.2, providing a toolbox for geographic display and cartographic analysis. The toolbox gives you the ability to plot geographically based information as easily as any other type of data that you can plot in MATLAB. Both vector and matrix map data can be displayed, manipulated, and analyzed. The toolbox manages the projection, clipping, and trimming of the data automatically for you, even if you change the projection. The Mapping Toolbox provides more than 60 map projections. There are extensive geographic analysis functions, such as computations of distance, tracks, great and small circles, intersections, and navigation functions. These computations can be made for a spherical body, or can make use of spheroidal models of the earth and other planets when more accuracy is required. Utility functions allow you to convert easily between different time, distance, and angle units. The toolbox provides a number of global map data sets, and allows you to import more detailed data from government sources over the Internet and on CD-ROM. These data sets include the Digital Chart of the World, Tiger/Line files, and Digital Elevation Models of the world and the United States. In addition to the command-line functions, the toolbox also provides an extensive suite of graphical user interfaces (GUIs) for accessing the toolbox functionality. These GUIs allow you to manage data interactively, plot it, modify the display, make measurements, and generate geographic data like tracks and circles. The GUIs are available as an integrated set and also are available individually.