How do I compute the fractal dimension of the Koch curve using Matlab?

Click For Summary
SUMMARY

This discussion focuses on computing the fractal dimension of the Koch curve using MATLAB, specifically through the box counting dimension method and the Grassberger-Procaccia algorithm. The box counting dimension is calculated using a binary image of the Koch curve, where nonzero pixels represent the curve. Key steps include padding the image, determining box sizes, counting filled boxes, and applying least squares fitting to derive the Hausdorff fractal dimension.

PREREQUISITES
  • Familiarity with MATLAB programming
  • Understanding of fractal geometry concepts
  • Knowledge of the box counting dimension method
  • Basic principles of the Grassberger-Procaccia algorithm
NEXT STEPS
  • Implement the box counting dimension method in MATLAB
  • Explore the Grassberger-Procaccia algorithm for correlation dimension
  • Review MATLAB's File Exchange for fractal dimension tools
  • Learn about least squares fitting techniques in MATLAB
USEFUL FOR

Mathematics students, researchers in fractal geometry, and MATLAB programmers interested in computational geometry and fractal analysis.

crazy2006
Messages
5
Reaction score
0

Homework Statement



I have a problem trying to code these two programs, one is related to the obtain the fractal dimension of the Koch curve by using the method of the box counting dimension and also using the Grassberger-Procaccia algorithm

Homework Equations


For the box counting dimension is just the lim N(l)/l as l goes to zero, so first I should generate a meshgrid of the Koch curve and count the number of filled boxes, how I do that in matlab?
For the Grassberger Procaccia or correlation dimension I have reviewed the formula, but no idea how to implement it

The Attempt at a Solution


I have not really a code to follow here, so any help it would be great
 
Physics news on Phys.org
I have submitted an http://www.mathworks.com/matlabcentral/fileexchange/30329-hausdorff-box-counting-fractal-dimension" to compute the fractal dimension Matlab's files exchange.

The function takes as input a binary image I. In this image, nonzero pixels belong to an object (e.g. the kock curve) and 0 pixels constitute the background.

Basically, the algorithm consists in the following steps:

1 - Pad the image with background pixels so that its dimensions are a power of 2.
2 - Set the box size 'e' to the size of the image.
3 - Compute N(e), which corresponds to the number of boxes of size 'e' which contains at least one object pixel.
4 - If e > 1 then e = e / 2 and repeat step 3.
5 - Compute the points log(N(e)) x log(1/e) and use the least squares method to fit a line to the points.
6 - The returned Haussdorf fractal dimension D is the slope of the line.

If you have any questions, you are welcome to ask.
 
Last edited by a moderator:

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
1
Views
2K
  • · Replies 20 ·
Replies
20
Views
3K
Replies
2
Views
1K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
865
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K