File Exchange

image thumbnail

Grey Wolf Optimizer Toolbox

version 1.3 (164 KB) by Seyedali Mirjalili
A toolbox for the Grey Wolf Optimizer (GWO) algorithm


Updated 22 May 2018

View Version History

View License

This is a simple toolbox with a use-friendly graphical interface, which is very suitable for those without high programming skills.
The parameters of the GWO algorithm can be easily defined in the toolbox.
The default name of the objective function is CostFunction. If you have a look at the CostFunction.m file, you may notice that the cost function gets the variables in a vector ([x1 x2 ... xn]) and returns the objective value. You can either write you objective function in this file or create a new file and pass its name to the toolbox. Remember to follow the same structure for input and output if you decided to go for the second option.
The lower bounds and upper bounds of variables should also be written as lb1,lb2,...,lbn and ub1,ub2,...,ubn. If all of the variables have equal lower and/or upper bounds you can just define lb and ub as two single number numbers: lb, ub.

Just run the GWO_toolbox.m file and enjoy!

The GWO algorithm can also be downloaded here:

This is the source codes of the paper:

S. Mirjalili, S. M. Mirjalili, A. Lewis, Grey Wolf Optimizer, Advances in Engineering Software, Volume 69, March 2014, Pages 46-61, ISSN 0965-9978,

More information can be found in:

Other relevant submissions:

I have a number of relevant courses in this area. You can enrol via the following links with 95% discount:

A course on “Optimization Problems and Algorithms: how to understand, formulation, and solve optimization problems”:

A course on “Introduction to Genetic Algorithms: Theory and Applications”

Cite As

Seyedali Mirjalili (2021). Grey Wolf Optimizer Toolbox (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (12)

Tariku Sinshaw Tamir

How can I load the convergence curve to base workspace please?

wei wang


ahmad eldeeb

how to extract the results of the toolbox to the workspace?


how can I initialize a population for speed control of PMSM using GWO ?

Muhammad Ansari

can anybody tell me how can put values GWO in mat-lab

Muhammad Ansari

can anybody send IEEE-33 bus i want apply in GWO IEEE-69 bus system

eric githua


Can you please explain how do you apply nonlinear constraints to the GWO?

Mingyu Liu

shaima elnazer

Many thanks for an excellent algorithm, i want to use it in image segmentation, any help

mohamed abu eita

Many thanks for an excellent algorithm, i want to use it in image segmentation, any help


MATLAB Release Compatibility
Created with R2012a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired: Multi-Objective Grey Wolf Optimizer (MOGWO)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!