Description Usage Arguments Author(s) See Also Examples
View source: R/LSD.makemovie.R
Interpolate rows of a matrix to yield a smooth transitions.
1 |
input |
a matrix with numerical entries. |
timepoints |
a integer vector containing the timepoints corresponding to the columns of 'input'. |
timestep |
a non-negative integer specifying the number of timesteps between the existing timepoints (defaults to |
motionline |
a integer vector giving the timepoints of the resulting matrix (derived from timepoints and timesteps by default). |
Achim Tresch, Bjoern Schwalb
1 2 3 4 5 6 7 8 9 | len = 10
x = sin(seq(0,2*pi,length=len*2))
fun = function(){n=sample(1:len,1);return(x[n:(n+len-1)])}
input = t(replicate(7,fun(),simplify=TRUE))
input = input + rnorm(length(input))/2
par(mfrow=c(1,2))
plotmatrix(input,main="original",cols=1:7,type="o")
mov = makemovie(input,timestep=0.2)
plotmatrix(mov,main="interpolated",cols=1:7,type="o")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.