It is my understanding that you have successfully created the custom Regression Ouput Layer – ‘myLayer’. You want to have some hidden layers and ‘myLayer’ in layers array. You could consider following codes:
layers = [
imageInputLayer([28 28 1])
Refer to fullyConnectedLayer documentation for weight and bias properties of fullyConnectedLayer.