3
votes

I have a matrix z that spits out a 20 by 20 matrix with with values starting at -9 to -739. I downloaded rgl but I can't figure out how to use it with my matrix: z[i, j]

1

1 Answers

3
votes

How about:

set.seed(101)
z <- matrix(sample(-739:-9,replace=TRUE,400),20)
library(rgl)
persp3d(z,col="gray")

enter image description here