Desktop Tools and Development Environment, MATLAB® Version 7.6 (R2008a)

New features and changes introduced in this version are organized by these topics:

Desktop New Features Video

For an overview of the major new features in the MATLAB® Desktop Tools and Development Environment area, watch this video demo. You can also access this and other video demos by selecting the Demos tab in the Help browser, and then selecting MATLAB > New Features in Version 7.6.

Startup and Shutdown

New features and changes introduced in Version 7.6 (R2008a) are:

Windows® Platforms — Startup Changes, Including Use of My Documents/MATLAB or Documents/MATLAB Directory

On Microsoft® Windows® platforms, when MATLAB starts, it automatically adds the My Documents/MATLAB directory (or Documents/MATLAB on Windows Vista™) to the top of the MATLAB search path. This directory is known as the userpath. If you remove the My Documents/MATLAB (or Documents/MATLAB) directory from the search path and save the changes, either using the Set Path dialog box or using the rmpath and savepath functions, the MATLAB search path will not include the userpath directory at the next startup. On Windows platforms, the userpath is also the default startup directory.

Use the new function, userpath, to view the current value, clear the value so the directory is not on the search path and is not the startup directory, specify a different value, or reset the value to the default. For more information, see Startup Directory (Folder) on Windows® Platforms and the userpath reference page.

Compatibility Considerations.   In previous versions, MATLAB automatically added the My Documents/MATLAB directory (or Documents/MATLAB on Windows Vista platforms) to the search path upon startup, even if you had removed it from the path and saved your changes during the previous session.

UNIX® Platforms — Startup Changes

On The Open Group UNIX® platforms, when MATLAB starts, it automatically adds the userhome/Documents/MATLAB directory to the top of the MATLAB search path. This directory is known as the userpath. Use the new function, userpath, to view the current value, clear the value so the directory is not on the search path, specify a different value, or reset the value to the default. You can also specify that userpath be the MATLAB startup directory by setting the value for the environment variable MATLAB_USE_USERWORK to 1 prior to startup. For more information, see Startup Directory on UNIX® Platforms and the userpath reference page.

Compatibility Considerations.   In previous versions, no directories were added to the search path upon startup.

Macintosh® Platforms — Startup Changes

On Apple® Macintosh® platforms, when MATLAB starts, it automatically adds the userhome/Documents/MATLAB directory to the top of the MATLAB search path. This directory is known as the userpath. Use the new function, userpath, to view the current value, clear the value so the directory is not on the search path, specify a different value, or reset the value to the default. If you start MATLAB from a shell, you can also specify that userpath be the MATLAB startup directory by setting the value for the environment variable MATLAB_USE_USERWORK to 1.

For more information, see Startup Directory on Macintosh® Platforms and the userpath reference page.

Compatibility Considerations.   In previous versions, no directories were added to the search path upon startup.

Macintosh® Platforms — Define Startup Options Using New Dialog Box

On Apple Macintosh platforms, you can specify startup options using the new Start MATLAB Settings dialog box. The first time you start MATLAB Version 7.6 (R2008a), the Start MATLAB Settings dialog box opens automatically. It does not open automatically on subsequent startups; to open the dialog box, double-click Start MATLAB Settings, located in the same directory as the MATLAB application.

You can set these options and others:

You can create and save multiple startup options files, each with different settings. For more information, see Specifying Startup Options for Macintosh® Platforms.

Macintosh® Platforms — Run Startup Diagnostics

Upon startup on Macintosh platforms, MATLAB automatically runs diagnostics to ensure your system has the required X11 and Sun Microsystems™ Java™ applications. If there are no problems, MATLAB starts as expected. If there is a problem, MATLAB displays a dialog box informing you of the problem and how to address it. You can run these diagnostics manually from the Start MATLAB Settings dialog box, using items in the Diagnostics menu. For more information, see Specifying Startup Options for Macintosh® Platforms.

Updated Version of JVM™ Software on Solaris™ Platform

MATLAB is now using Sun Microsystems JVM™ Version 6 on the Sun Microsystems Solaris™ platform.

Compatibility Considerations.   If you use a specific version of Sun Microsystems Java with MATLAB on the Solaris platform, this change might impact your work.

Changes to Abnormal Termination Process

When MATLAB encounters a serious problem, such as a segmentation violation, a dialog box opens to notify you about the problem. From the dialog box, you can close MATLAB, or try to save your work in progress before closing.

If you try to save your work in progress, be aware that MATLAB is in an unreliable state and you should exit MATLAB as soon as you finish saving your work. The Command Window displays the message Please exit and restart MATLAB to the left of the prompt, which reminds you to discontinue use. For more information, see Abnormal Termination.

Compatibility Considerations.   In previous versions, when MATLAB encountered a serious problem, an error message appeared in the Command Window that instructed you to close MATLAB.

With multithreaded computation enabled, a platform-specific dialog box appeared, from which you immediately closed MATLAB.

Desktop

New features and changes introduced in Version 7.6 (R2008a) are:

Customize the MATLAB® Desktop and Editor Toolbars

Rearrange, add, or remove buttons and other controls from the MATLAB desktop or Editor toolbars using File > Preferences > Toolbars. Alternatively, right-click a toolbar and select Customize from the context menu.

For more information, see Toolbars Preferences for the MATLAB® Desktop and Editor

There are new buttons you can add to the MATLAB desktop toolbar:

You can also add Save All and Save As buttons to the Editor toolbar.

You can change the position of the toolbars within a tool, for example, putting both the Editor and Editor cell mode toolbars next to each other instead of stacked. To move a toolbar, grab the anchor for a toolbar, then drag the toolbar to the new location.

Close a Browser with New Method

Close an open browser in MATLAB with a new close method. For example, open a browser to display the MathWorks Web site by running [stat,h1]=web('http://www.mathworks.com'). Then close(h1) closes that browser window. For more information, see the reference page for the web function.

Manage Your License

You can use new licensing features to perform license management activities, such as activating your license, deactivating your license, or updating your license. You can also visit the License Center at the MathWorks Web site to perform other license-related activities. Access the features by selecting Help > Licensing.

Check for Updates Feature Enhanced

When you select Help > Check for Updates, the dialog box now allows you to see the latest versions for all MathWorks™ products, or just those you install. You can also access release notes for each product from the dialog box. For more information, see Check for Updates.

Running Functions — Command Window and History

Command History Preference — Default Value Changed

The default value for the Command History preference, Save after n commands, is now 1. This allows you to more easily rebuild your state in MATLAB if MATLAB terminates abnormally, such as after a power failure. For more information about this preference, see Preferences for Command History.

Compatibility Considerations.   Previously, the default value for the Save after n commands preference was 5.

Help

Preferences for Help on Selection

When you click a function name in the Command Window or Editor, and then press F1 or select Help on Selection from the context menu, the help appears in a pop-up window by default. Now, you can specify that the help appear in the Help browser rather than in a pop-up window via the new Help on Selection preference. For more information, see Help on Selection — Specifying Where It Displays.

Slight Reordering of Products in Help Browser

In the Help browser, the order of some documentation names in the Contents pane and the Product Filter preference dialog box has changed slightly. Documentation now appears in this order:

Workspace, Search Path, and File Operations

New features and changes introduced in Version 7.6 (R2008a) are:

Array Editor Renamed to Variable Editor; Offers Enhanced Support for Structures and Classes

The Array Editor has been renamed to the Variable Editor, which better reflects its support for non-array data such as structures and properties.

The Variable Editor now reports, just below the toolbar, the class and size of the selected variable. For many classes, there is also a link to help for the class. To view a structure in the Variable Editor, double-click one of its elements. The resulting display is much like the display of that element in the Workspace browser, showing the Class, Value, Size, Min, Max, and other information. For more information about the Variable Editor, see Viewing and Editing Workspace Variables with the Variable Editor.

Use the data brushing button on the Variable Editor toolbar to mark observations on graphs and then remove or save them to new variables. For more information, see Data Brushing for Graphs and Linked Variables.

The Variable Editor supports the new MATLAB class system. Double-click an object in the Workspace browser, and it opens in the Variable Editor. The Variable Editor displays the object, the class, and the properties of the object.

Compatibility Considerations.   In previous versions, the Variable Editor was called the Array Editor. Starting in R2008a, MATLAB Version 7.6, the tool will be referred to as the Variable Editor.

Search Path — Changes to User Portion

By default, MATLAB adds a directory to the top of the search path upon startup, known as the userpath directory. By default, its value is Documents/MATLAB on Windows platforms, or My Documents/MATLAB on Windows Vista platforms. On UNIX and Macintosh platforms, the default directory is userhome/Documents/MATLAB. Use the new function, userpath, to specify a different directory, clear the userpath value, or reset it to the default value. On UNIX and Macintosh platforms, you can specify additional directories for MATLAB to add to the top of the search path upon startup using the MATLABPATH environment variable. When you remove the userpath portion of the search path, it clears the value for userpath and might impact the startup directory. For related information, see Startup and Shutdown. For details see Search Path and the userpath reference page.

Compatibility Considerations.   In previous versions, on Windows platforms, MATLAB added the default directory to the search path upon startup, even if you removed it and saved the changes to the path. On UNIX and Macintosh platforms, MATLAB did not add a directory to the search path on startup.

New Context Menu Options in Current Directory Browser

The context menu, which you access by right-clicking anywhere within the Current Directory browser, provides these three new options for creating M-files in the current directory:

For details about these enhancements, see Opening Files.

Compatibility Considerations.   The New > M-File option is replaced by the New > Function M-File option, which has the same effect.

File and Directory Comparisons Tool

The File Comparisons tool is now called the File and Directory Comparisons Tool. In addition to enabling you to compare lines in two text files, it now enables you to:

See Comparing Files and Directories for details.

Tuning and Managing M-Files

Profiling — Setting Intel® Multi-Core Processors

If your system uses Intel® multi-core chips, and you plan to profile using CPU time, set the number of active CPUs to 1 before you start profiling. See Intel® Multi-Core Processors — Setting for Most Accurate Profiling for details.

Editing and Debugging M-Files

New features and changes introduced in Version 7.6 (R2008a) are:

Stand-Alone Editor No Longer Provided

The MATLAB stand-alone Editor (meditor.exe) is no longer provided. Instead of the stand-alone Editor, you can use the MATLAB Editor.

Compatibility Considerations.   Some users have preferred the stand-alone Editor to the MATLAB Editor because of slightly better startup performance and because it does not require a MATLAB software license. For those situations, you can use any text editor you have, such as UltraEdit or Emacs.

Run/Continue Button Now Two Separate Buttons

The Continue button is now separate from the Run button. Previously, the Run button served as both the Run and Continue button.

Image of a portion of the Editor toolbar with callouts to the Run button and the Continue button.

Compatibility Considerations.   You now use the Run button to execute a run configuration and the Continue button to continue execution of an M-file after a breakpoint during debugging. See Running M-Files in the Editor and Stepping Through an M-File for details.

Evaluate Entire File Button Off Toolbar by Default

The Evaluate Entire File button, , is no longer on the Editor Cell Mode toolbar by default.

Compatibility Considerations.   Previously, the Evaluate Entire File button was on the Editor Cell Mode toolbar by default. You can put the Evaluate Entire File button back on the toolbar by customizing it. See Customize the MATLAB® Desktop and Editor Toolbars for more information.

TLC and XML Syntax Highlighting Supported

You can specify preferences for TLC and XML syntax highlighting in the Editor/Debugger Language Preferences panel by selecting File > Preferences > Editor > Language and then, in the Language drop–down menu choosing TLC or XML/HTML.

Click Help in the Preferences dialog box for more information.

Code Folding Enhanced to Support More Language Constructs

You can enable code folding for all these programming constructs:

Prior to MATLAB Version 7.6 (R2008a), code folding was supported for function code and function help only.

See Code Folding — Expanding and Collapsing M-File Constructs for details.

mlint Function Uses Preference Settings when Java™ Software is Available

When Sun Microsystems Java software is available, the mlint function honors the M-lint preferences that you specify using the M-Lint Preferences dialog box (File > Preferences > M-Lint).

In addition, the '–config=settings.txt' option to the mlint function enables you to override the current default M-Lint preferences settings with a settings file that you previously created and saved using the M-Lint Preferences dialog box. If you use the '–config=settings.txt' option, you must specify the full path to the file. If you prefer that m-lint ignore all M-Lint preferences and use the factory default settings instead, specify the '–config=factory' flag. See m-lint for details.

Compatibility Considerations.   Previously, the mlint function always used the factory default settings, regardless of the M-Lint preferences that you set. To restore that behavior, use the '–config=factory' flag on the mlint function.

New M-Lint Warning Related to the MException Class

MATLAB Version 7.6 (R2008a) adds a new M-Lint warning related to the MException class. This warning, along with two M-Lint warnings added in MATLAB Version 7.5 (R2007b), intentionally make it difficult for you to completely ignore an error without receiving an M-Lint warning. It is a best practice to check error information even when an error is expected or frequent, so that you can rule out unexpected situations.

The three messages are as follows—the first is the one added in MATLAB Version 7.6 (R2008a):

For example, suppose you want to read options from a file, options.txt, but it is acceptable if that file is not present. You might write the following code, expecting the read_options program to throw an error if the file is not present:

options = {};
try
    options = read_options( ‘options.txt' );
end

The problem with the preceding code is that the file might be present, but its permissions may prevent the program from reading it. The program ignores the file, and potentially confuses the user, who knows the file is there. Better code for accomplishing the task is as follows, which assigns a structure value to the variable err if an error is thrown in the try block. The structure value contains information about the error that was thrown.

try
    options = read_options( ‘options.txt' );
catch err
    if strcmp( err.identifier, ‘Program:ReadOptions:NoOptionsFile' )
        options = {};
    else
        rethrow( err );
    end
end

Using this code, if a problem other than the "file is missing" error occurs, MATLAB reports the error to the user. For instance, MATLAB reports an error if the file format is incorrect, or if the file has the wrong permissions.

If you feel comfortable ignoring the errors completely, it is probably best to use the try statement with no catch statement, and suppress the M-Lint warnings that result. You can suppress the warnings through the M-Lint preferences or by placing the %#ok pragma at the end of the line that triggers the message. However, The MathWorks™ suggests that if you suppress an M-Lint message, you include a comment in your code indicating why you think it is appropriate to ignore the message.

For more information about the MException class, see the Error Handling section in the MATLAB Programming Fundamentals documentation.

dbstop and dbclear Functions — Option to Specify File Not on Path

The –completenames option to the dbstop and dbclear functions enables you to set and clear breakpoints, respectively, for M-files that are not on the search path in MATLAB. See dbstop and dbclear for details.

edit Function Can Create New File in Existing Subdirectory

The edit function now allows you to specify a file that is not in the current directory. If the file does not exist, the edit function creates it in the directory you specify. However, the directory, must exist; the edit function will not create a directory for you. See edit for details.

Nest Cells for Rapid Code Iteration; Includes Changes to Cell Highlighting

You can nest cells in an M-file, including within functions and control statements, such as for loops and if-then blocks. This gives you greater control over how a published document appears. This nesting ability also enables you to evaluate subsections of code on a finer grain. See Nest Cells for Finer Control for details.

Compatibility Consideration.   With the introduction of nested cells, cells definitions result in cell highlighting that looks different from previous releases. See Understanding and Defining Cells for details.

Publishing M-Files

New features and changes introduced in Version 7.6 (R2008a) are:

Publish Functions and Scripts Using Publish Configurations; Includes Replacement of Publishing Preferences

In the Editor, you can now do the following when publishing M-file code:

To create a publish configuration, first open an M-file in the Editor. Then, select File > Publish Configurations for filename > Edit Publish Configurations for filename. In the resulting Edit M-File Configurations dialog box, modify the MATLAB expression, specify Publish settings, and name the publish configuration. For more information, see Creating a Publish Configuration for an M-File.

Image of Edit M-File Configurations dialog box.

Compatibility Considerations.   Previously, preferences for publishing and publishing images were available on the Preferences dialog box, which you accessed by selecting File > Preferences > Editor/Debugger and then choosing the Publishing or Publishing Images node. Now you set these preferences when you create or update a publish configuration by using the Publish settings options on the Edit M-file Configurations dialog box.

The Edit M-file Configurations dialog box continues to provide support for creating configurations that enable you to run an M-file. These are now called run configurations to differentiate them from publish configurations.

Nest Cells for Finer Control

You can nest cells in an M-file, including within functions and control statements, such as for loops and if-then blocks. This gives you greater control over how a published document appears. This nesting ability also enables you to evaluate subsections of code on a finer grain when using rapid code iteration.

You can insert white space before the double percent (%%) characters that specify a cell break (which is also referred to as a cell divider). This helps to improve readability of the M-file when the cell break is within indented code. In prior releases, the %% characters had to be in the first column of the code.

The following image shows a simple example of an M-file with nested cells.

Image of Editor with an open M-file. The code includes a for loop with a cell break inserted. Yellow highlighting appears from the cell break to the end of the for loop.

If you publish the file to HTML (reducing the size of the images), the cell break nested within the for loop causes MATLAB to publish each iteration of the for loop as it evaluates the code in the loop:

Image of Web Browser with the for loop code enclosing the three graphs generated by the for loop.

Similarly, the cell break within the for loop enables you to run the M-file and experiment with the marker size value without the need to save the file between adjustments:

Image of Editor with M-file code, including a for loop. The cursor is at the end of the value specified for the MarkerSize option and the pointer is hovering over the Increment value near cursor and evaluate cell button in the Editor Cell Mode tool bar.

For more information see Formatting M-File Code for Publishing and Using Cells for Rapid Code Iteration and Publishing Results.

Compatibility Consideration.   In prior releases, the cell break characters (%%) had to be in the first column of the code for the Editor to recognize the characters as a cell break. This is no longer true, the Editor now recognizes these characters as a cell break regardless of the amount of white space that precedes them.

Furthermore, with the introduction of nested cells, inserting cell breaks in this release has different effects than in the previous release. In the previous release, if you inserted a cell break before a subfunction declaration, MATLAB created two cells; one above the cell break and one below it. Now, if you insert a cell break, MATLAB also inserts implicit cell breaks.

In the example shown, it inserts two implicit cell breaks in the subfunction where you inserted the explicit cell break; one on the first line of the subfunction and one on the last line of the subfunction. This results in three cells: one containing the entire file, one containing the collatzplot_new function, and one containing just the Collatz Problem cell title.

Nested cells are introduced to support function publishing.

See Understanding Nested Cells for details.

Publish Button Moved

The Publish button, , is now located on the Editor toolbar.

Compatibility Considerations.   Previously, the Publish button was located on the Editor Cell Mode toolbar. Now you find it on the Editor toolbar.

Publish Trademark Symbols

If the comments in your M-file include trademarked terms, you can format the comment to produce a trademark symbol (™) or registered trademark symbol (®) in the published output. See Specifying Trademarks in M-Files for Publishing for details.

Specifying Code for MATLAB® Software to Evaluate with the publish Function

Use the codetoEvaluate option to the publish function to specify code that you want MATLAB software to evaluate when it publishes an M-file. By default, this is the code in the M-file. However, if you want, you can use this option to specify additional code or alternative code for MATLAB to evaluate. For example, you might want MATLAB to evaluate code that calls the M-file that you are publishing.

stopOnError Option No Longer Available with publish Function

The stopOnError option is no longer available for the publish function. MATLAB software will always stop when an error occurs, unless you add code to handle the error.

Compatibility Considerations.   To have MATLAB continue processing code when an error occurs, handle the error using a try-catch statement. For more information, see The try-catch Statement.

Include Snapshot of M-file Output in Published Document

You can include snapshots of output that an M-file generates within a published document. Select Cell > Insert Text Markup > Force Snapshot. This menu option inserts the snapnow function into your M-file code. This is particularly useful when you have code that generates numerous images that you want to include in the published document. See Forcing a Snapshot of Output in M-Files for Publishing for details.

The following image, for example, shows a published document that uses this feature (with the size of the images reduced). Notice that the published images appear after the for loop that generates them.

Image of Web Browser with the code for a for loop. Following the for loop are the three images generated by the for loop.

Internationalization

Locale Information Added to MATLAB® Documentation

Information about using locale in MATLAB can be found in Internationalization in the Desktop Tools and Development Environment documentation.

Changes to Locale Database

Windows® Platform Changes.   On Microsoft Windows systems, users can select the Pashto language with the Afghanistan country code. This locale setting is ps_AF.1256.

Macintosh® OS X Platform Changes.   On Apple Macintosh OS X systems, for users selecting the Chinese language and the China country code, the locale setting is zh_CN.gb2312. The previous setting was zh_CN.GBK.

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS