How to create a generate a 1-D Array that extends beyond max value?

gmt math -o0 -T0/7/3 T =
        9  # Desired value not generated by the above command.

How can I do to get a list that includes the max value? I was looking a modifier like +e but it doesn’t work in this case.

Finally, if you are only providing an increment and will obtain min and max from the data, then it is possible (max - min)/inc is not an integer, as required. If so, then inc will be adjusted to fit the range. Alternatively, append +e to keep inc exact and adjust max instead (keeping min fixed).

But it should right? Or is the doc misleading ?

The GMT answer is correct. Try Matlab or any other tool that compute the same and see.

Edit. Sorry, I didn’t read it all with attention. When I try +e, I get

gmt math -o0 -T0/7/3+e T =
gmtmath [ERROR]: Option T: Modifier +e only applies when increment is given without any range

which I don’t understand.

For the record, this script gives me the solution that I want


end2=$(gmt math -Q $end $start SUB $increment DIV CEIL $increment MUL $start ADD = )
gmt math -o0 -T$start/$end2/$increment T =

And this for dates


end2=$(gmt math -Q $end $start SUB $increment DIV CEIL $increment MUL $start ADD --TIME_UNIT=d -fT =)
gmt math -o0 -T$start/$end2/$increment T =