Stuart’s MATLAB Videos

Watch and Learn

Modifying a Script to Track a datetime Duration Value 1

Posted by Stuart McGarrity,

Today I’m just making a small modification to an existing script to store a variable with the saveValue function I developed a while ago. The variable is of type duration, part of the recently added set of datetime functions. Features used in this code-along style video include: datetime and duration tables @media (min-width: 992px)... read more >>

Some Uses of the MATLAB Function inputname 9

Posted by Stuart McGarrity,

Sometimes I need to display the name of a variable as a character array. This can help with the updating of variable names in code and automating the importing or exporting of multiple variables to data sources such as Excel. To do this I use the MATLAB function inputname in... read more >>

Creating a MATLAB Function to Split a URL into Component Parts, Part 2

Posted by Stuart McGarrity,

This code-along video is the second in a series where I’m creating a MATLAB function to split a URL into component parts. Here I add more tests, return more components, and add a parameter to specify which components to return. Topics I cover in this part include: Writing tests for functions using assert Matching regular expressions... read more >>

Creating a MATLAB Function to Split a URL into Component Parts, Part 1 3

Posted by Stuart McGarrity,

I often need to break up a URL string into components such as protocol, hostname, file path, query parameters, etc. Here, I create a function to do this, similar to the fileparts function in MATLAB. Topics I cover in this code-along style video include: Writing a function Writing tests for functions using assert Matching regular expressions using regexp Using data... read more >>

Building a Matrix in a For Loop 4

Posted by Stuart McGarrity,

On an existing post, a MATLAB user asked how to vertically concatenate a number of matrices taken from MAT-files. Here is a code-along of me working through a couple of options for this. @media (min-width: 992px) { .containing-block { width: 100%; } } Play the video in full screen mode for... read more >>

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