On opening the example using following command in MATLAB window:
There is no error while training the network from the default location.
But if the ObjectDetectionUsingYOLOV3DeepLearningExample.mlx file is copied and run from some different location then it throws error as you have mentioned.
The solution to error is that on copying the ObjectDetectionUsingYOLOV3DeepLearningExample.mlx file, also copy all the files available in left side in current folder as shown below:
There is a file generateTargets.m which is missing while you are running the yolov2_Copy file and hence got the error.
Refer to documentaton for more information about supporting functions for object detection using YoloV3 Deep Learning.