%% Create 2-D Crop Layer
% Create a 2-D crop layer and connect both of the inputs using a layerGraph object.
% Create the layers.

layers = [
     imageInputLayer([32 32 3],'Name','image')
     crop2dLayer('centercrop','Name','crop')]

% Create a layerGraph. The first input of crop2dLayer is automatically connected to the first output of the image input layer.

lgraph = layerGraph(layers)

% Connect the image input layer to the "ref" input of the 2-D crop layer.

lgraph = connectLayers(lgraph,'image','crop/ref')  

% Copyright 2012 The MathWorks, Inc.