I want to create a linspace with a condition for the spacing, so that the spacing has a maximum allowed value. For example, if the spacing gets to high the function creates more points. Is this possible?
Best Answer
Hi,
if you know the maximum allowed spacing you can use:
function result = mySpacing(StartValue,EndValue,maxSpaceValue)
result = linspace(StartValue,EndValue,ceil((EndValue-StartValue)/maxSpaceValue+1));
end
This will ensure that the spacing is always smaller or equal to the given argument:
Best Answer