Uniform grid


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.


Create a uniform closed interval with a positive step.

Grid = unigrid(0,0.1,1);
% Note that Grid(1)=0 and Grid(end)=1

Create semi-open interval.

Grid = unigrid(0,0.1,1,'[)');
% Grid(1)=0 and Grid(end)=0.9

See Also


Was this topic helpful?