x = linspace(0, 5, 51)
Alternatively, you might have noticed that the set of points you're looking for are 0.1 increments, and could have used the colon operator to accomplish the same:
x = 0:.1:5
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!