https://au.mathworks.com/help/reinforcement-learning/ref/rl.replay.rlhindsightreplaymemory.generatehindsightexperiences.html
generateHindsightExperiences - Generate hindsight experiences from hindsight experience replay...
This MATLAB function generates hindsight experiences from the last trajectory added to the specified hindsight experience replay memory buffer.
from experiencegeneratehindsightexperiencesreplay