Doug's MATLAB Video Tutorials

Finding infrequent errors in MATLAB with DBSTOP if error

Posted by Doug Hull,

Finding infrequent errors in MATLAB with DBSTOP if error Some errors happen in MATLAB infrequently. If you don’t know the conditions when they occur, setting a breakpoint might not work. Using DBSTOP if error will have MATLAB stop on a line in the editor only when the error condition is tripped. ... read more >>

Bad coding practices to avoid

Posted by Doug Hull,

Bad coding practices to avoid I was revisiting older posts, and this is one of my most frequently referenced posts. I teach the MATLAB 101 class to every new hire at MathWorks. Inevitably, someone will ask me how to make a global variable. I then Google up: “How to make MATLAB Doug Cry” and... read more >>

Vintage Videos: Still relevant

Posted by Doug Hull,

Vintage Videos: Still relevant There are certain timeless questions about MATLAB. I was just asked about this and knew I had made a video about changing object properties in GUIDE. var... read more >>

Simple example of storing data as a matrix or structure

Posted by Doug Hull,

Simple example of storing data as a matrix or structure When we design a program, the way we store our data will have an effect on how our code looks as we manipulate that data later. In this video we had the choice to store the coordinates of a robot and obstacles either as a matrix or as a... read more >>

Vectorizing code in MATLAB

Posted by Doug Hull,

Vectorizing code in MATLAB When you vectorize code, you avoid looping through an array and instead do operations on the matrix level. This avoids for loops in MATLAB. The reason for vectorizing are often stylistic. Vectorizing is preferred because it can make your code shorter, easier to read and maintain. This... read more >>

Adding callbacks to lines and axes in MATLAB

Posted by Doug Hull,

Adding callbacks to lines and axes in MATLAB A callback is a function that gets called when you perform certain actions. For instance, you might want something to happen when you click on a line in MATLAB, or when you move the mouse in MATLAB. These events will trigger a function if you define the buttondownfcn... read more >>

Interuptable callbacks and BusyAction in MATLAB 5

Posted by Doug Hull,

Interuptable callbacks and BusyAction in MATLAB If you push a button in a MATLAB UI and this starts a long calculation, what do you want to have happen if the user pushes the button a second time? Interuptable property and BusyAction property of a UICONTROL dictate the behavior. This video shows the different interactions... read more >>

Using synthetic data to test algorithms in MATLAB

Posted by Doug Hull,

Using synthetic data to test algorithms in MATLAB This week we are making up some data and doing a couple of visualizations. We then modify the data to do a reality check on a simple algorithm. This allows us to gain confidence in our algorithm before we send it real data. ... read more >>

Modifying Excel column names to legal variables in MATLAB 2

Posted by Doug Hull,

Modifying Excel column names to legal variables in MATLAB I have been using MATLAB tables lately. In doing that, MATLAB will store meta data with your numeric data. I was bringing data in from Excel files. Each column name will eventually become a variable name. If these column names include characters like ‘(‘ then they... read more >>

Simplify, simplify, simplify 1

Posted by Doug Hull,

Simplify, simplify, simplify I often say that one my greatest qualifications for troubleshooting MATLAB code is that I know I am not that clever, so I have to simplify things until I can understand them easily. It works really well when debugging MATLAB code. Use simpler data: Instead of... read more >>

These postings are the author's and don't necessarily represent the opinions of MathWorks.