File Exchange

image thumbnail


version (3.14 KB) by Nikesh Bajaj
Linear Feedback Shift Register


Updated 11 Apr 2018

View Version History

View License

Linear Feedback Shift Register
It includes 3 different versions, 1st one to check the properties, 2nd one, if you are interested in storing all the states of LSFR and 3rd, faster
You can check the examples at

Cite As

Nikesh Bajaj (2021). Nikeshbajaj/Linear_Feedback_Shift_Register (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (8)

Theodore Grosch

asdasd asdasdasdasd


ahmed benalla


David Alldred

Very good but the way 'c' grows inside the loop makes it run slow for large runs.

Adding 'c = zeros(outputs,n);' right after the first line defining 'n=length(s)' made this this run 25x faster in my case.



Very useful and easy to use for generating Pseudo random binary sequence.

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

Community Treasure Hunt

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

Start Hunting!