Doug's MATLAB Video Tutorials

Results for: Level: Advanced

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 >>

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 >>

Debugging: creating a line with empty data

Posted by Doug Hull,

Debugging: creating a line with empty data In this video we are sorting through some data making a different line for all the data points that match certain criteria. At some point in the algorithm none of the data meets the criteria. This is the equivalent of this: >> a = 1 a = ... read more >>

uicontextmenu and ButtonDownFcn in MATLAB 5

Posted by Doug Hull,

uicontextmenu and ButtonDownFcn in MATLAB When you use ButtonDownFcn in MATLAB, your callback is given an automatic input called hObject. This hObject is the handle of the object that you interacted with to invoke the callback, which makes it easy to define behavior based on the selected object. This is a little trickier when working... read more >>

Using one callback function for multiple UI objects in GUIDE 1

Posted by Doug Hull,

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... read more >>

Custom interactive graphics in MATLAB 3

Posted by Doug Hull,

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. ... read more >>

Knowing when to optimize code in MATLAB

Posted by Doug Hull,

Knowing when to optimize code in MATLAB I work with a lot of recent computer science graduates who are learning MATLAB. Something I see from them is they often want to choose some complicated but fast algorithm to do a task I give to them in MATLAB class. Only after they spend a long time... read more >>

Making a line visible over an image in MATLAB 5

Posted by Doug Hull,

Making a line visible over an image in MATLAB It can be difficult to see a line that is drawn over an image. The line is often lost in the background colors. That is why cursors are colored as they are, so that they are visible on any background. I demonstrate some code that makes a... read more >>

Generalizing the access to an array of structures in MATLAB 2

Posted by Doug Hull,

Generalizing the access to an array of structures in MATLAB Recently a MATLAB user asked me how to make it possible to work with an array of structures in such a way that she could filter the array of structures and then combine the remaining fields. Once combined she would run arbitrary processing functions on this combined data. This generalized... read more >>

Using ‘dbstop if error’ and conditional breakpoints to debug MATLAB 1

Posted by Doug Hull,

Using ‘dbstop if error’ and conditional breakpoints to debug MATLAB Sometimes MATLAB throws an error, but because the error is inside of a function you can not see what caused this error. By telling the debugger to stop execution under certain conditions or right before an error is thrown you will be better able to understand the conditions that... read more >>

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