0

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!

1
Contributor
1
Reply
3
Views
7 Years
Discussion Span
Last Post by buckkitty
0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.