MATLAB Tips and Previews
d+zeros(n,m)
is the fastest way to generate an array containing the scalar value d in all its locations.
repmat(d,n,m) is typically the slowest method, which is contrary to the help text for repmat! The only time repmat is fast is when the final array is nearly square.
Contextual Menus, i.e., menus that pop up under the mouse. These are a new object type uicontextmenu to go along with uicontrol and uimenu object types. Uicontextmenus are essentially uimenu objects associated with handle graphics objects such as lines, axes, etc.
There is a new uicontrol style called a togglebutton. This appears as a pushbutton uicontrol which toggles on and off like a radio button. Toggle Button uicontrols can be used to implement toolbars such as those that appear in MS products, the MATLAB Command Window and Editor Window. The btngroup function uses toggle buttons to implement toolbars.
| 'native' | or | 'n' | local machine format - the default |
| 'ieee-le' | or | 'l' | IEEE floating point with little-endian byte ordering |
| 'ieee-be' | or | 'b' | IEEE floating point with big-endian byte ordering |
| 'vaxd' | or | 'd' | VAX D floating point and VAX ordering |
| 'vaxg' | or | 'g' | VAX G floating point and VAX ordering |
| 'cray' | or | 'c' | Cray floating point with big-endian byte ordering |
| 'ieee-le.l64' | or | 'a' | IEEE floating point with little-endian byte ordering and 64 bit long data type |
| 'ieee-be.l64' | or | 's' | IEEE floating point with big-endian byte ordering and 64 bit long data type. |
In addition, the form [filename,permission,machineformat]=fopen(fid) returns the filename, permission, and machineformat associated with the given file identifier. You can determine your native byte order by issuing the command [fn,pm,mf]=fopen(1);
|
The Mastering MATLAB Toolbox |
|
Questions and comments regarding Mastering MATLAB, Mastering MATLAB 5, and the Mastering MATLAB Toolbox can be sent via e-mail to: mm@eece.maine.edu. We welcome all comments, bug reports, errata, and suggestions for future editions.