It seems you're trying to execute createImagePatchesFromHypercube outside of the "Classify Hyperspectral Images Using Deep Learning" example. createImagePatchesFromHypercube is a helper function and preferably should not be called outside the specified example.
But, if you want to use it, you can navigate to the folder path, where the function resides. You can directly reach to that path by executing the following command,
Hope this helps.