Doug's MATLAB Video Tutorials

Results for: Format: Video

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

Using Datetick with Plotyy in MATLAB 2

Posted by Doug Hull,

Using Datetick with Plotyy in MATLAB Recently, I needed to plot two different sets of time series data on the same axes, but they were at different scales. In this simplified example, I show how you can change the x-labels to display the month name. This requires you capture the handles of the axes created... 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 >>

Exploring data through a series of vizualizations 1

Posted by Doug Hull,

Exploring data through a series of vizualizations When we get unknown data, we do not always know where it will lead us. This video shows the series of visualizations that I went through to answer a question about my data. By showing the process, we can see there there are lots of reality checks on... read more >>

Searching for permutations of a string in a list in MATLAB 4

Posted by Doug Hull,

Searching for permutations of a string in a list in MATLAB In this video a colleague was looking in a large list to see if each element was a permutation of any element of a shorter list. I name these lists Haystack and Needle so it is easy to remember which I am looking for and which I am looking... read more >>

Non-uniform spacing for surf in MATLAB

Posted by Doug Hull,

Non-uniform spacing for surf in MATLAB In this video, we will use non-uniform spacing for the X vector going into a surf plot in MATLAB. This allows us to selectively increase the resolution of a graphic in the more important regions. This could be useful if the calculations are computationally expensive. This is... read more >>

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