linspace (3, 5, 5) in matlab

In MATLAB, linspace can be used to generate a vector of a specified number of equally spaced values between two numbers.

To generate five equally spaced values between 3 and 5, linspace(3, 5, 5) can be used.

main.m
>> linspace(3, 5, 5)
ans =
    3.0000    3.5000    4.0000    4.5000    5.0000
78 chars
4 lines

Here, the first argument 3 is the starting number, the second argument 5 is the ending number and the third argument 5 is the number of equally spaced values to be generated between the two specified numbers.

related categories

gistlibby LogSnag