okay that helps thanks, i finished the rest but the thing is now, i do not know how to write the program for the transpose A_s. which the formula used ismatrix A_s=(A+A_t)/2
the normal matrix i obtained with this
insert
Code:
char line[64];
double **A, *x;
A=(double **)calloc(4,sizeof(double *));
for(i=0;i<4;i++)
A[i]=(double *)calloc(4 ,sizeof(double));
x=(double *)malloc(4*sizeof(double));
while(fgets(line,64,input_1,) != NULL
{
if(k==4) sscanf(line, "%lf %lf %lf %lf", &x[0],&x[1],&x[2],&x[3]);
else
{
sscanf(line, "%lf %lf %lf %lf", &A[m][0],&A[m][1],&A[m][2],&A[m][3]);
}
m++;
}
printf("Matrix A is:");
printf("\n\n");
for(q=0;q<4;q++)
printf("%6.3f ",A[0][q]);
printf("\n");
for(j=0;j<4;j++)
printf("%6.3f ",A[1][q]);
printf("\n");
for(j=0;j<4;j++)
printf("%6.3f ",A[2][q]);
printf("\n");
for(j=0;j<4;j++)
printf("%6.3f ",A[3][q]);
printf("\n\n");
printf("Vector x is:");
printf("\n\n");
printf(" x[] = ");
for(j=0;j<4;j++)
printf("%6.3f ",x[q]);
printf("\n\n");
and then its
smatrix(A,x,n);
here is where i dnt know how to make it transpose
am i just suppose to switch A[#][q] to [q]A[#]