Hi Prerna,
The procedure for installing any add on is as follows:
- On your Matlab start page, go to apps.
- Click on Get More Apps, which will cause the Add On explorer to open.
- Search for the Global Optimization Toolbox, and download it.
With specific reference to gaoptimset, documentation says that it is not recommended to be used post R2018B. Instead, optimoptions can be used((Not recommended) Create genetic algorithm options structure - MATLAB gaoptimset - MathWorks India).
Hope it helps