Stuart’s MATLAB Videos

Watch and Learn

Results for: 2008

Puzzler: Intermediate sums 6

Posted by Doug Hull,

MATLAB challenges get thrown around the halls of The MathWorks with fair regularity. I thought this most recent one would make a good puzzler.
You have a matrix that has 3xN rows and you want to expand it such that after every third row of the original, you insert a… read more >>

Video tutorial: 3d indexing 4

Posted by Doug Hull,

The MATLAB user has this: clear clc M(:,:,1) = [1,2;3,4]; M(:,:,2) = [21,22;23,24]; J = [1,2; 2,1]; They want this: ans = [1 22 23 4] They tried this: D = M(:,:,J) % This doesn’t work, This video discusses this solution: [nR, nC] = size(J); D = zeros(nR,nC); for r = 1:nR for c = 1:nC … read more >>

Video tutorial: Verbal code review

Posted by Doug Hull,

Talking through your code is an excellent way to find bugs. By discussing the code you have written line by line, you are forced to understand it better. This is a common practice at most software companies. By talking through this simple function, we are able to find a small… read more >>

Contest: Final wrap up 2

Posted by Doug Hull,

Well, it was a great contest this season. I was very happy to see that each King of the Hill tended to get arguably better than the prior. I wanted to find out how much better, so I used the actual test suite and the eight different Kings… read more >>