function grava_matriz(pasta,nome,S)
m = size(S,1);
n = size(S,2);
arq = fopen(sprintf('%s/%s.mat',pasta,nome),'wt');
assert(arq > 0);
fprintf(arq,'%22.14e ',S);
fclose(arq);