LinSpace
Returns a linearly spaced vector.
avec = linspace(a=1.0, b=10.0, N=11)
Interface
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE LinSpace
MODULE PURE FUNCTION Linspace(a, b, N) RESULT(Ans)
REAL(Real32 | Real64) , INTENT(IN) :: a
!! left end of 1D domain
REAL(Real32 | Real64) , INTENT(IN) :: b
!! right end of 1D domain
INTEGER(I4B), OPTIONAL, INTENT(IN) :: N
!! Number of points including a and b
REAL(Real32 | Real64) , ALLOCATABLE :: ans(:)
!! Number of nodes in mesh
END FUNCTION Linspace
END INTERFACE LinSpace
program main
use easifemBase
implicit none
call display(linspace(1., 10., 10), "ans: ", full=.true.)
end program main
See results
results
ans:
-------
1.0000
2.0000
3.0000
4.0000
5.0000
6.0000
7.0000
8.0000
9.0000
10.0000