Programming and Data Types    

MATLAB Programming Tips

This chapter is a categorized compilation of tips for the MATLAB programmer. Each item is relatively brief to help you to browse through them and find information that is useful. Many of the tips include a link to specific MATLAB documentation that gives you more complete coverage of the topic. You can find information on the following topics:
Command and Function Syntax
Syntax, command shortcuts, command recall, etc.
Getting help on MATLAB functions and your own
Development Environment
Useful features in the development environment
M-File Functions
M-file structure, getting information about a function
Function Arguments
Various ways to pass arguments, useful functions
Program Development
Suggestions for creating and modifying program code
Using the debugging environment and commands
Variable names, global and persistent variables
String concatenation, string conversion, etc.
Evaluating Expressions
Use of eval, short-circuiting logical expressions, etc.
Precedence rules, making file changes visible to MATLAB, etc.
Program Control
Using program control statements like if, switch, try
Save and Load
Saving MATLAB data to a file, loading it back in
Files and Filenames
Naming M-files, passing filenames, etc.
Reading and writing various types of files
Managing Memory
What you can do to use less memory in your MATLAB applications
Optimizing for Speed
Acceleration, vectorizing, preallocation, and other ways you can get better performance
Starting MATLAB
Getting MATLAB to start up faster
Operating System Compatibility
Interacting with the operating system
Learning about the demos supplied with MATLAB
For More Information
Other valuable resources for information

  Platform-Specific Memory Topics Command and Function Syntax