Learn R Programming

geostats (version 1.6)

boxcount: box counting

Description

Count the number of boxes needed to cover all the 1s in a matrix of 0s and 1s.

Count the number of boxes needed to cover all the 1s in a matrix of 0s and 1s.

Usage

boxcount(mat, size)

boxcount(mat, size)

Value

an integer

an integer

Arguments

mat

a square square matrix of 0s and 1s, whose size should be a power of 2.

size

the size (pixels per side) of the boxes, whose size should be a power of 2.

Examples

Run this code
g <- sierpinski(n=5)
boxcount(mat=g,size=16)
g <- sierpinski(n=5)
boxcount(mat=g,size=16)

Run the code above in your browser using DataLab