MathWorks | Stuart’s MATLAB Videos
391 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
7h 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
1M 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
1M 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
2M 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
3M 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
MathWorks | Stuart’s MATLAB Videos
4M ago
In my last post, I prototyped some code that plots the progress of my data download job. I noticed that the axes were not correct, so I need to fix that and some other issues.
Features covered in this code-along style video include:
axes
yyaxis
Play the video in full screen mode for a better viewing experience.  ..read more
MathWorks | Stuart’s MATLAB Videos
5M ago
I have a script that runs for many hours and downloads a large amount of data from a web service. It sometimes slows down or even stops, so I want to be able to understand its progress better by visualizing it. I plan to try adding a plot in the main loop and update it each time.
Features covered in this code-along style video include:
plot
Play the video in full screen mode for a better viewing experience.  ..read more
MathWorks | Stuart’s MATLAB Videos
5M ago
Here I finish developing a local file cache for my video analysis function. In this phase, I incorporate the changes I made to my function into a web app that uses it. I hope it will greatly reduce the start time of the app.
Features covered in this code-along style video include:
App Designer
App Testing Framework
Play the video in full screen mode for a better viewing experience.  ..read more
MathWorks | Stuart’s MATLAB Videos
6M ago
Here I continue developing a local file cache for my recurring data analysis job. Next, I want to add support for new videos being added to the SharePoint folder.
Features covered in this code-along style video include:
table
datetime
Play the video in full screen mode for a better viewing experience.  ..read more
MathWorks | Stuart’s MATLAB Videos
7M ago
I have a recurring MATLAB processing job that analyzes the metadata of the files in a large SharePoint folder. It can take several minutes to get all the metadata. However, the metadata in older files rarely changes. So I thought I would try and implement a local file cache that stores the meta data of all the files, and only goes to SharePoint for new or updated files.
Features covered in this code-along style video include:
webread
datetime
Play the video in full screen mode for a better viewing experience.  ..read more