However, when I try to use it within my Layers array, I get the following error:
Undefined function or variable 'globalAveragePooling2dLayer'.
Error in cnn_trial (line 64)
I have the Neural Networks toolbox and I have used the average pooling layer before. How can I fix this issue?