Doug's MATLAB Video Tutorials
December 9th, 2013
Using one callback function for multiple UI objects in GUIDE
By default, GUIDE creates one callback function for every object in a UI. Sometimes, you want to have one callback function serve multiple objects. This video shows one way to do this, by manually editing the callback property for multiple objects to point to the same callback function. This trick can help make for somewhat cleaner UI code.
December 3rd, 2013
MATLAB: Manipulating the data in a UItable in GUIDE
If you have a UItable in a UI made in GUIDE, you might want to change that data in a callback. For instance, you might want to change the values or increase the size of the dataset. This short video shows you the process to get the data into a variable, manipulate it, then set it back into the UItable.
November 18th, 2013
Knowing when to optimize your graphics in MATLAB
The MATLAB user’s question in this video was about optimizing their graphics in MATLAB. They were worried that the architecture they were choosing would be too slow. One test is worth a thousand expert opinions. Before starting to do some difficult optimization in your code in the name of speed, you should check to see if the current implementation will be a problem. In this case, rather than a difficult optimization, they simply changed to a low level command for graphics rather than the heavier weight one. This, plus just testing the speed quickly showed that they need not worry about optimizing in the first place.
November 11th, 2013
Interactively editing a colormap in MATLAB
I recently wanted a colormap that was distinctive. I wanted the zero values to be one color while the negative and positive values were different shades. This video shows how to do this interactively. The skills shown here work for lots of different colormap tasks.
After I did this manually, I found there was a MATLAB File Exchange file that does this kind of thing for you.
October 24th, 2013
Custom interactive graphics in MATLAB
Knowing how to use callbacks in MATLAB allows you to customize your graphics and make them more interactive. This short video shows you how to highlight a line in MATLAB by clicking on it.
October 17th, 2013
When only small speed improvements are possible in MATLAB
The profiler is very important when you want to speed up your code. It is nearly impossible to know where the bottleneck will be in your code until it is written and tested. Often times there are basic things you can do to speed your code. These basic things include pre-allocate vectors. What do you do when the basic things do not help or have already been done?
October 8th, 2013
Using Cody for algorithm development
Do you need to develop an algorithm in MATLAB? Do you have tests in MATLAB that would tell you if the algorithm were working correctly? If you do, you might not need to actually write the MATLAB code. If the algorithm can be described in an interesting way that would make people want to show their MATLAB prowess by creating the algorithm then you might just be in luck.
September 25th, 2013
Monte carlo testing of the Luhn checksum in MATLAB
This video builds on the last one. A quick monte carlo test is built to see if the Luhn Algorithm really will detect transpositions. The testing indicates that only one pair of numbers transposing is undetected.
September 16th, 2013
Luhn checksum implemented in MATLAB
The Luhn algorithm is a fast checksum that allows you to know if an entered series of numbers has any of the repeated digits or transpositions that are common when typing numbers in. By having a simple checksum, you can validate a number before doing a more costly database check. This video explains how to implement the algorithm. A future video will discuss a simple testing mechanism to show what failure modes go undetected by this checksum.
September 9th, 2013
Populating a uicontrol and reading a directory in MATLAB
Recently, a MATLAB user asked me how to build a UI which lets the user display any image in a directory by selecting the name of the image from a pop-up menu. This uses a few concepts like the DIR command, setting the string of a UICONTROL, and using callback functions.
These postings are the author's and don't necessarily represent the opinions of MathWorks.