ch19


Release 11 Enhancements (Release 11 New Features)  Release 11 New Features if ((parent.frames.lengthSummary of New Features MATLAB Compiler 2.0 supports much of the functionality of MATLAB 5. The new features of the Compiler are: Data constructs Multidimensional arrays Cell arrays Structure arrays Sparse arrays Programming tools Variable input and output argument lists (varargin/varargout) try ... catch ... end switch ... end Language enhancements Persistent variables load and save commands Improved Compiler options Macro options Error/warning messages Improved mex and mbuild scripts Stand-alone Compiler Data Constructs Multidimensional Arrays Multidimensional arrays in MATLAB are an extension of the two-dimensional matrix. You access a two-dimensional matrix element with two subscripts: the first represents the row index and the second represents the column index. In multidimensional arrays, use additional subscripts for indexing. For example, a three-dimensional array has three subscripts and a four-dimensional array has four subscripts. Cell Arrays Cell arrays are a special class of MATLAB arrays where elements, or cells, contain MATLAB arrays. Cell arrays allow you to store dissimilar classes of arrays in the same array. Structure Arrays Structures are a class of MATLAB arrays that can store dissimilar arrays together. Structures differ from cell arrays in that you reference them by named fields. Sparse Arrays Sparse arrays provide an efficient representation of arrays that contain a significant number of zero-valued elements. Programming Tools Variable Input Arguments The special argument varargin can be used to pass any number of input arguments to a function. Variable Output Arguments The special argument varargout can be used to return any number of output arguments from a function. try ... catch ... end In an M-file, the statements between try and catch are executed until an error occurs. Then, the statements between catch and end are executed. If no error occurs, the statements between catch and end are not executed. switch ... end The switch statement lets you conditionally execute code depending on the value of a variable or expression. Language Enhancements Persistent Variables Variables that are defined as persistent do not change value from one call to another. Persistent variables may be used within a function only and they remain in memory until the M-file is cleared or changed. load and save Commands The support for load and save has been enhanced to include loading into a structure. Improved Compiler Options The collection of new and improved options provides you with greater flexibility to control Compiler 2.0. You also have full access to Compiler 1.2 and its set of existing options. Macro Options These options (-m, -p, -x, and -S) let you quickly and easily generate C and C++ stand-alone applications, and MATLAB and Simulink C MEX-files, respectively. Each macro replaces a sequence of several Compiler options making it much easier to generate your output. Error/Warning Messages The MATLAB Compiler 2.0 contains a comprehensive set of error and warning messages that help you isolate problems with your code. Improved mex and mbuild Scripts The mex script, which allows you to compile MEX-functions, and the mbuild script, which allows you to customize the building and linking of your code, have been enhanced to automatically search your system for supported third-party compilers. Stand-Alone Compiler You can run the MATLAB Compiler 2.0 from the DOS or UNIX command line, making it unnecessary to have MATLAB running on your system. You can call the Compiler directly from a makefile. This stand-alone MATLAB Compiler is faster than previous versions of the Compiler because it does not have to start MATLAB each time you invoke a compilation. [ Previous | Next ]

Wyszukiwarka

Podobne podstrony:
ch19
ch19
ch19
CH19 (6)
ch19 (12)
ch19
ch19
ch19
ch19
CH19
ch19
ch19
ch19 (8)
CH19 (14)
CH19 (14)
ch19 (7)

więcej podobnych podstron