> restart;with(plots): interface(showassumed = 0):
 

On initialise la date_du_jour : 

> date_du_jour := StringTools:-FormatTime("%A %d %B %Y    %T"):
date_du_jour;
 

 

On se place dans le répertoire Supplement_1 : 

> currentdir("C:/Users/jcle/Maple_10/Supplement_1"):
#ssystem("dir");
 

> A := [[x,1,3.4,2,5.3],[y,1,5.6,2,4.5]];
 

[[x, 1, 3.4, 2, 5.3], [y, 1, 5.6, 2, 4.5]] 

> writedata(terminal,A,[string,integer,float,integer,float]);
 

x 1 3.4 2 5.3
y 1 5.6 2 4.5
 

> B := array(1..3,1..3):
for i to 3 do for j to 3 do
    B[i,j] := evalf(exp(i+I*j),5) end do end do:
print(B);
 

B 

> P := proc(f,x::complex(numeric))
       fprintf(f,`%g %g\t`,Re(x),Im(x)) end proc:
writedata(terminal,B,float,P);
 

1.4687 2.2874 -1.1312 2.4717 -2.6911 0.3836
3.9923 6.2177 -3.0749 6.7188 -7.3151 1.0427
10.852 16.901 -8.3585 18.264 -19.885 2.8345
 

Explicitly open the file: 

> fichier := fopen(`testFile.txt`,WRITE,TEXT):
 

Ecrire la date de création du fichier : 

> fprintf(fichier,"#\n# jour de création = %a \n#\n",date_du_jour):
 

Write the first matrix: 

> writedata(fichier,A,[string,integer,float,integer,float]);
 

Write the second matrix: 

> writedata(fichier,B,float,P);
 

Close the file. 

> fclose(fichier);