Software Listing of Author : "Malcolm Wood"
- Assertion function
- License: Shareware
- Price:


Widely used in languages such as C and (now) Java, assertions are a very useful way of detecting bugs as early as possible in development. Simply assert in the code that you believe something to be true: ASSERT(ischar(x) && ~isempty(x),'x is a non-empty string') If, at runtime, x is not a non-empty string, the ASSERT function throws an error. Using the assertion, rather than waiting for something else to go wrong, guarantees that the problem doesn't go unnoticed, and gives you a meaningful error message. It also serves as a kind of documentation: when you come back to this code in future to change the way that variable "x" is handled, you can be sure that you don't need to consider the case where "x" is empty or is not a string. There are two reasons to use ASSERT rather than just using "error" itself. Firstly, assertions are...
- Publisher: Malcolm Wood
- Date Released: 05-05-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- CVS Differences Report
- License: Freeware
- Price: 0.00


An easy-to-use MATLAB function which lets you quickly review the changes to files in a CVS sandbox. Uses "cvs diff" to get the list of changes, creates an HTML report showing the same information but in a much more readable form, and shows it in the MATLAB Help Browser. At its most useful when reviewing small changes to a large number of files because: 1) the output is much easier to read than the plain text from CVS. 2) the differences for all files are available on one page, whereas using other diff tools (e.g. WinMerge via TortoiseCVS) you would have to open each file individually. To use, either change MATLAB's working directory to the directory of interest in the CVS sandbox and type: >> cvsdiff or specify the directory using (e.g.): >> cvsdiff C:worksandbox
- Publisher: Malcolm Wood
- Date Released: 12-01-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Error API for Application Development
- License: Freeware
- Price: 0.00


Those of us developing graphical applications in MATLAB do not want our users to be exposed to the internals of our work. Unfortunately, the built-in "error" function prefixes to the error message the name of the function which threw that error, which is unlikely to be of any interest to the user and serves only to confuse. This is particularly true when using the MATLAB Compiler to create applications for use by people with no knowledge of MATLAB. The API supplied here provides a wrapper for the "error" function which stores the error message without that extra line, so that it can be retrieved later and shown to the user. To use this functionality, replace calls to "error" with identical calls to "xError", e.g.: error('MyApplication:MyErrorIdentifier','This operation did not work because %s',reason); becomes:...
- Publisher: Malcolm Wood
- Date Released: 06-03-2013
- Download Size: 20 KB
- Download
- Platform: Matlab, Scripts
- exportToZip: Identifies the dependencies of an M-file and creates a ZIP file
- License: Shareware
- Price:


The function "mydepfun" determines the dependencies of an M-file, ignoring files inside the MATLAB "toolbox" directory. Skipping these files gives significant performance improvements over calling "depfun" directly, especially in MATLAB installations which include multiple toolboxes. The assumption is the same as that in "mypath.m", i.e. that most of us do our work in directories outside $matlabroot/toolbox. The function "exportToZip" creates a ZIP file containing all the dependencies identified by "mydepfun" for one or more MATLAB functions. This simplifies the process of passing your work to another user, or uploading it to MATLAB Central, by reducing both the effort required and the likelihood of a file being missed out. The limitations of "depfun" apply: for example, that dependencies introduced by calls such as "eval('peaks')"...
- Publisher: Malcolm Wood
- Date Released: 05-01-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- find_in_models: Search the entire block diagram hierarchy
- License: Shareware
- Price:


find_system provides the option to search inside library links, but does not currently give the option to search inside model references. This function provides this option, and, unlike find_system itself, can also close block diagrams after searching them. This ensures scalability when searching large hierarchies. The usage is very similar to that of find_system itself except that a model name or handle must be specified. The return type also depends on the inputs in the same way as for find_system: specifically the return type is a cell array of strings unless the input is a numeric handle ot the "FindAll" option is supplied and "on". When the return type is a cell array of strings, any block diagrams which are loaded during the search are closed again. This means that the caller must take care before calling get_param on any...
- Publisher: Malcolm Wood
- Date Released: 22-04-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Plot Stock Prices
- License: Freeware
- Price: 0.00


A very simple function which uses the DataFeed toolbox to retrieve stock prices for a specified number of days from the Yahoo service and plots them. e.g. to see how your Microsoft shares have done over the last three months, just type: >> show_chart('MSFT',90)
- Publisher: Malcolm Wood
- Date Released: 13-05-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
- Resizable MATLAB figures
- License: Freeware
- Price: 0.00


This is a layout manager for axes and controls in a MATLAB figure, designed for graphical user interfaces in which, during resizing of the figure, some controls (e.g. buttons) are to remain the same size while others (e.g. axes, text fields, list boxes) are to change size. To achieve this, the figure is split into a grid with a border and with spacing between each cell. Some rows and columns (at least one of each) are variable in size and the rest are fixed. When the figure is resized, the available space (i.e. that not required by the fixed-size rows and columns) is distributed among the variable-sized ones according to a specified ratio. If there is not enough space for the fixed-size rows or columns, these (and the spacing between them) will be made smaller too. Controls can be merged across multiple rows and/or columns and can...
- Publisher: Malcolm Wood
- Date Released: 17-03-2013
- Download Size: 20 KB
- Download
- Platform: Matlab, Scripts
- Run M-Lint on a directory tree and filter results
- License: Freeware
- Price: 0.00


This function addresses two of the major shortcomings of the M-Lint report which is available in the MATLAB Directory Browser. Firstly, it will perform a recursive analysis, i.e. the current directory and its subdirectories and their subdirectories etc. Secondly, it allows the user to filter out classes of message which are not of interest. To run the function on a directory tree, simply change to that directory and type: >> runmlint An HTML report will be created, showing all the messages issed by M-Lint for files in the current MATLAB directory and its subdirectories. To filter the results, create an "options" file. Each line in this file specifies a "filter", which can: * filter out all messages with a specific ID * filter out all messages in a specific file * filter out messages with a specific ID in a specific file * filter out...
- Publisher: Malcolm Wood
- Date Released: 11-04-2013
- Download Size: 10 KB
- Download
- Platform: Matlab, Scripts
