# NOT RUN {
############
### EG 1 ###
############
## define the dimensions of the gaussian image (matrix)
xdim=101
ydim=101
## sigma in the x direction. The y sigma defaults to the sig.x if not supplied
sig.x=5
## build the first example
gaus1 <- build.gaus(xdim,ydim,sig.x)
###################
## PLOTTING EG 1 ##
###################
image(1:nrow(gaus1),1:ncol(gaus1),useRaster=TRUE,gaus1)
############
### EG 2 ###
############
## define the dimensions of the gaussian image (matrix)
xdim=101
ydim=201
## define a sigma in the both the x and y direction
sig.y=5
sig.y=20
## define the center (peak) location of the guassian
x.mid = 30
y.mid = 120
## now build the gaussian
gaus2 <- build.gaus(xdim,ydim,sig.x,sig.y,x.mid,y.mid)
##################
## PLOTTING EG2 ##
##################
image(1:nrow(gaus2),1:ncol(gaus2),useRaster=TRUE,gaus2)
# }
Run the code above in your browser using DataLab