MathWorks | Stuart’s MATLAB Videos
393 FOLLOWERS
On MathWorks, Stuart uses video to share his experiences solving problems with MATLAB day-to-day, interesting new features, plus tips and tricks he has picked up along the way.
MathWorks | Stuart’s MATLAB Videos
1w ago
4:55
In a previous blog video, I manually paused my code and changed the value of a variable, in order to change the behavior of my code. This time, my code has stopped at a keyboard command and I want to... read more >> ..read more
MathWorks | Stuart’s MATLAB Videos
1M ago
16:42
I’ve created quite a few unit tests for one of my MATLAB apps, but I’m not sure if I’m testing all it’s functionality. That is where the Coverage Report comes in. I’m... read more >> ..read more
MathWorks | Stuart’s MATLAB Videos
3M ago
My app takes a while to start because it has to load a good amount of data from a database, then analyze it before its ready to be used. I have an idea of how to speed this up, so I’m going to use the Profiler, as always, as a first step to understand the execute time.
Features covered in this code-along style video include:
Profiler
Play the video in full screen mode for a better viewing experience.  ..read more
MathWorks | Stuart’s MATLAB Videos
4M ago
I often use tokens and other types of authentication to access web resources. There is one I use where the authentication expires after 1 year, and I’m often taken by surprise by this. So I want to add a check to some existing code that will notify me in advance when the token is about to expire.
Features covered in this code-along style video include:
datetime
Play the video in full screen mode for a better viewing experience.  ..read more
MathWorks | Stuart’s MATLAB Videos
5M ago
I need to create a simple function to do some string processing in one of my web apps. I thought I would try and show you a typical process of developing the algorithm, creating the function, adding an arguments block and then creating a test script.
Features covered in this code-along style video include:
join
arguments block
Script-Based Unit Tests
Play the video in full screen mode for a better viewing experience.  ..read more
MathWorks | Stuart’s MATLAB Videos
6M ago
I have a function which analyzes the contents of a few hundred folders. Its taking several minutes to run and I use it a lot, so I want to try and make it execute faster.
I propose using the profiler to try and understand where the time is spent and explore some code changes.
I often find with my performance improvement work, that the first changes I make are to my algorithm, or code architecture. For example, by ensuring that I only execute the computations that I need to. Later, I might then look at speeding up those computations.
Features covered in this code-along style video include:
pro ..read more
MathWorks | Stuart’s MATLAB Videos
7M ago
I use parfor a lot when processing large amounts of data. It could be on my local machine, or it could be on a remote cluster. It is very simple to convert a for loop to a parfor loop and often you do not need to change the code in your loop.
A parfor is efficient when the work required for each iteration is similar, but if it’s not, then, near the end of your loop, some workers can become idle. This is where parfevalcan be helpful. It’s a little more complicated to use, but it will keep all workers busy until the work is finished. As a result, you should get your calculation finished sooner ..read more
MathWorks | Stuart’s MATLAB Videos
7M ago
Here, I make one or two more changes to my class that creates a non-expiring SharePoint token that I made in part 1. Then I go about updating my other functions to make use of the new class.
Features covered in this code-along style video include:
Class Definitions
Play the video in full screen mode for a better viewing experience.  ..read more
MathWorks | Stuart’s MATLAB Videos
8M ago
I create a lot of code that reads and writes to our internal SharePoint file storage. To do that, it needs to use an authorization token. This token is time limited to an hour and sometimes that causes my code to fail when it expires. I want to create a more robust method of generating a token and my first idea is to create a class that will regenerate the token if it has or is about to expire.
Features covered in this code-along style video include:
classdef
Play the video in full screen mode for a better viewing experience.  ..read more
MathWorks | Stuart’s MATLAB Videos
9M ago
I have a function that returns the duration of a video file. It only supports standard video files like MP4 or MKV and uses videoReader. I want to add support for animated GIF files which are not supported by videoReader.
Features covered in this code-along style video include:
videoReader
imread, imfinfo
Play the video in full screen mode for a better viewing experience.  ..read more