The Nelder–Mead Optimization Method (used in the fminsearch command of MATLAB) is explained in this video.
The MATLAB demo codes can be downloaded from the following links:
https://drive.google.com/file/d/1x7BPOvYFthXs-3ZtN2ohxQttZoPUxPf1/view?usp=sharing
https://drive.google.com/file/d/18I8dERLjyl0dIS4m383c8H-rck_Wc-jD/view?usp=sharing