Hi,
I am new to C programming and MATLAB but I have a class and an assignment to write a C program for following:
a. read a data file (filename.txt) which has 2 arrays A and B
- A is 5x4 and B is 4x5 matrix
b. calculate F=AxB and solution should be 5x5 matrix
c. print F into a filename.txt
This is what I have as shown by prof in a way...is this correct and how do I do b. and c.? Thnx
Code:#include "stdio.h" main() FILE *fin; fopen(fin) fscanf(fin, '%d %d', &row, &column); for (i=0; i<row; i++); { fscanf(fin, '%f %f %f %f', &a, %b, %c, %d); ArrayA[i][0]=a; ArrayB[i][1]=b; ArrayC[i][2]=c; ArrayD[i][3]=d; } for (i=0; i<column; i++); { fscanf(fin, '%f %f %f %f %f', &a, &b, &c, &d, &e); ArrayA[i][0]=a; ArrayB[i][1]=b; ArrayC[i][2]=c; ArrayD[i][3]=d; ArrayE[i][4]=e; }