我有两个数据结构:
atomName <855*1 cell>
atomSASA <855*1 double>
我在代码中使用它来生成输出文件:
%write out SASA values for individual atoms to file
results_file = fopen('output.txt','w');
fprintf(results_file,'SASA for Individual Atoms: \n');
i=1;
while i < (855)
fprintf(results_file,'Atom %s %s: %.3f\n',i,cell2mat(atomName(i)),atomSASA(i));
i = i + 1;
end
该文件的前 32 行似乎是正确的,但从第 33 行开始,在 Atom 一词之后有一个额外的字符。字符改变每一行,最终通过数字、大写字母 AZ、小写字母 az 等。我想从每一行中删除这个额外的字符:
Atom ! HG23: 6.286
Atom " N: 0.000
Atom # CA: 0.000
Atom $ C: 0.000
Atom % O: 0.000
Atom & CB: 0.000
Atom ' CG: 0.000
Atom ( CD1: 0.000
Atom ) CD2: 0.000
Atom * CE1: 0.000
Atom + CE2: 0.000
Atom , CZ: 0.000
Atom - OH: 0.000
Atom . H: 0.000
Atom / HA: 0.000
Atom 0 HB2: 0.000
Atom 1 HB3: 0.000
Atom 2 HD1: 0.000
Atom 3 HD2: 0.000
Atom 4 HE1: 0.000
Atom 5 HE2: 0.000
Atom 6 HH: 0.000
Atom 7 N: 0.000
Atom 8 CA: 0.000
Atom 9 C: 0.000
Atom : O: 0.000
Atom ; CB: 0.000
Atom < CG: 0.000
Atom = CD: 0.000
Atom > CE: 1.208
Atom ? NZ: 1.312
Atom @ H: 0.000
Atom A HA: 0.000
Atom B HB2: 0.000
Atom C HB3: 0.000
Atom D HG2: 0.000
Atom E HG3: 0.000
Atom F HD2: 0.000
Atom G HD3: 0.000
Atom H HE2: 0.000
Atom I HE3: 33.979
Atom J HZ1: 0.000
Atom K HZ2: 0.000
Atom L HZ3: 44.513
Atom M N: 0.000
Atom N CA: 0.000
Atom O C: 0.000
Atom P O: 0.000
Atom Q CB: 0.000
Atom R CG: 0.000
Atom S CD1: 0.000
Atom T CD2: 0.000
Atom U H: 0.000
Atom V HA: 0.000
Atom W HB2: 0.000
Atom X HB3: 0.000
Atom Y HG: 0.000
Atom Z HD11: 0.000
Atom [ HD12: 0.000
Atom \ HD13: 0.000
Atom ] HD21: 0.000
Atom ^ HD22: 0.000
Atom _ HD23: 0.000
Atom ` N: 0.000
Atom a CA: 0.000
Atom b C: 0.000
Atom c O: 0.000
Atom d CB: 0.000
Atom e CG1: 0.000
Atom f CG2: 0.000