--Please use the code Tags to make the code more readable in the forum.
I didn't check all of your code, but I noticed these two lines:
- Code: Select all
The first line creates an array of size ncluster. But the second line is wrong for two reasons:
1. index ncluster is out of bounds. as ncluster is the size of the array, the highest valid index is (ncluster-1).
2. The array np is not initialized in any way. Taking a value from this array is a pretty much random value.
This said it doesn't seem to be a very good idea to use the value of nn as array index either. Make sure you use valid and useful array indexes everywhere.
Who needs a signature anyway.