This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.



Grid = unigrid(StartValue,Step,EndValue)
Grid = unigrid(StartValue,Step,EndValue,IntervalType)


Grid = unigrid(StartValue,Step,EndValue) returns a uniformly sampled grid from the closed interval [StartValue,EndValue], starting from StartValue. Step specifies the step size. This syntax is the same as calling StartValue:Step:EndValue.

Grid = unigrid(StartValue,Step,EndValue,IntervalType) specifies whether the interval is closed, or semi-open. Valid values of IntervalType are '[]' (default), and '[)'. Specifying a closed interval does not always cause Grid to contain the value EndValue. The inclusion of EndValue in a closed interval also depends on the step size Step.


collapse all

Create a uniform closed interval grid with a positive increment.

grid = unigrid(0,0.1,1);
ans = 0
ans = 1

Note that grid(1) = 0 and grid(end) = 1.

Create a uniform grid with a semi-open interval.

grid = unigrid(0,0.1,1,'[)');
ans = 0
ans = 0.9000

In this case, grid(end) = 0.9

Create a decreasing grid with a semi-open interval.

grid = unigrid(1,-0.2,0,'[)')
grid = 1×5

    1.0000    0.8000    0.6000    0.4000    0.2000

Extended Capabilities

See Also


Introduced in R2011a