Does anyone understand why Data2 would not equal Data? I print, and can see, that they LOOK the same, i.e. have the same number of rows and columns with the same values in each element. But when I pass the matrices to a calc function, they give different results. I am guessing that there is a missing (or extra) character, space, line somewhere that I can't "see".

The only difference is the way that I fill Data1 and Data2. data_options actually contains 660 elements and Data2 would contain 649. Am I filling Data2 incorrectly? Here are snippets of code...

double **data;
double **dataTS;
double *data_options;		
int numobs = 59;
int Dim1 = 11;

		data = matrix(numobs,Dim1);
		for (n=0; n<numobs; n++) 
		{
			for (k=0; k<Dim1; k++)
			{
				data[n][k]=data_options[n*Dim1+k];
			}
		}


		dataTS = matrix(numobs, Dim1); 
		for (n = 0; n<numobs; n++)
		{	
			for (k=0; k<Dim1; k++)
			{
				dataTS[n][k] = data[n][k];
			}
			
		}

thank you!

correction: I should have referred to the matrices as Data and DataTS, as they are named in the code. Sorry.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.