Step 1:  

digitTrain4DArrayData is a Matlab function designed to provide some interesting training data.  When you run it, it will load an array that contains 5000 examples of hand written digits between 0 and 9.  It also loads the "correct answer" labels.  Type help  digitTrain4DArrayData  in the command window to get more information about this function (including the angle at which the digit was written).
Load the data into the Matlab workspace and check to see what are the sizes of the images and the correct answer labels.  

clear all;
close all;
clc;


[XTrain,YTrain] = digitTrain4DArrayData;
size(XTrain)      %images
size(YTrain)      %correct answer labels