x = -10:0.01:1; in matlab

To create the array x with values ranging from -10 to 1 with an increment of 0.01, you can use the linspace function in Matlab as follows:

main.m
x = linspace(-10, 1, 1001);
28 chars
2 lines

The function takes three arguments: the start value (-10), the end value (1), and the number of points to generate (1001, which is equivalent to (1 - (-10))/0.01). The resulting array will have 1001 equally spaced values ranging from -10 to 1.

gistlibby LogSnag