File Exchange

image thumbnail

Simplified Gradient Descent Optimization

version (2.13 KB) by James Allison
Demonstration of the gradient descent optimization algorithm with a fixed step size.


Updated 07 Oct 2018

View License

This example was developed for use in teaching optimization in graduate engineering courses. This example demonstrates how the gradient descent method can be used to solve a simple unconstrained optimization problem. Taking large step sizes can lead to algorithm instability, but small step sizes result in low computational efficiency. A corresponding video can be found here:

Cite As

James Allison (2020). Simplified Gradient Descent Optimization (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (22)

Berkay Can

Thank you for commenting Ibrahim. A little while ago my original YouTube channel was deleted unexpectedly. I did restore most of my videos using a new channel:

I hope to update the links on the file exchange, but it may take some time. In the meantime you should be able to find videos for most of my FX submissions at the above channel.

ibrahim ali

this video is unavialable

1 1


Cyrus Fox





this .m file was very helpful while preparing to my optimization methods class
thank you, great work!



Is it a batch or a stochastic gradient descent ?

Heng JIao


Only changed video link in subscription. Code is unchanged.

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