Stuart’s MATLAB Videos

Watch and Learn

Cody Code-Along: R2016b Feature Challenge – String Array Basics, Part 3

Posted by Stuart McGarrity,

Here I continue with “Cody Code-Alongs” for the Release 2016b Features Challenge. This one looks at converting between strings and cell arrays of character arrays with missing values. I could not however figure out a better way how to set string elements to <missing>.
Features covered include:

string, cellstr

Follow me (@stuartmcgarrity) if… read more >>

Making a MATLAB Function to Re-Use Code

Posted by Stuart McGarrity,

Its common when you are developing code to find that you want to re-use a piece of it for some new dataset or task. Instead of copying and pasting, always consider writing a function. Here is an example of me doing this, moving the code out and updating my script… read more >>

Other Ways to Pause MATLAB

Posted by Stuart McGarrity,

A few weeks ago I talked about the new pause button in Release 2016a on the editor tab of the desktop. Someone asked what do you do if you want to pause your code but the editor was not open when you started it? Here are a couple of ways… read more >>

Developing a Script to Compare the Distribution of Website Page Response Times

Posted by Stuart McGarrity,

In this code-along style video I attempt to develop a script to import and analyze website page response times data, including doing some comparisons of distributions.
Features covered include:

readtable, with TextType=’string’
Table indexing
hist, and subplot

Follow me (@stuartmcgarrity) if you want to be notified via Twitter when I post.
@media (min-width: 992px) { .containing-block… read more >>

Debugging a Tricky Look-up Table Indexing Problem

Posted by Stuart McGarrity,

This morning I needed to debug an issue with a regularly used script. The code was converting numerical columns in a table to strings or categoricals by using a lookup table. I had a few levels of indirection which made it more complicated to understand what was going on. Breaking… read more >>

Use strlength to Detect Zero Length Strings

Posted by Stuart McGarrity,

You can’t use isempty to detect empty strings, as you would for character arrays, instead you should check for strlength being equal to zero or compare with an empty character vector. See the documentation for more information.
@media (min-width: 992px) { .containing-block { width: 100%; } }
Play the video in… read more >>

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