folder = ["d:\Profile\a2679\Desktop\Masterarbeit\EYcalc-master\LTSpice\Test\"] baseFileName = "Tandem_3T-series_1step"; filetype = ".net" fullfilename = folder + baseFileName + filetype %diese werden einzeln genereriet in einen loop liststr = ".step param Eg list 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30"; I1str = ".param I1 table(Eg,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0.0011569,9,0.0056613,10,0.0093309,11,0.012104,12,0.0077862,13,0.0097255,14,0.010748,15,0.0068772,16,0.0054381,17,0.0019474,18,0.00034485,19,0,20,0,21,0,22,0,23,0,24,0,25,0,26,0,27,0,28,0,29,0,30,0"; I2str = ".param I2 table(Eg,1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0.0014181,9,0.0061111,10,0.010488,11,0.01341,12,0.0086632,13,0.010946,14,0.012141,15,0.0079269,16,0.0065509,17,0.0032457,18,0.00051827,19,0,20,0,21,0,22,0,23,0,24,0,25,0,26,0,27,0,28,0,29,0,30,0"; codeanfang=[char('d:\\Profile\\a2679\\Desktop\\Masterarbeit\\EYcalc-master\\LTSpice\\Test\\Tandem_3T-series.asc\n',... 'V1 N001 0 0',... 'D1 N001 N002 {dio2}\n',... 'I1 N002 N001 {I1}\n',... 'I�l2 N003 N002 {I2}\n',... 'D2 N002 N003 {dio1}\n',... 'V2 N002 0 {V2}\n',... 'R1 0 N003 0.0001',... '.model D D\n',... '.lib d:\Profile\a2679\Eigene Dateien\LTspiceXVII\lib\cmp\standard.dio\n',... '.model dio1 D(Is=1.61E-14 N=1)\n',... '.param V2 0.5\n',... '.dc V1 1.7 1.8 0.01\n',... '.model dio2 D(Is=1.61E-14 N=1)\n')]; codeende=[char('.backanno',... '.end')]; code = char(codeanfang, char(liststr), char(I1str), char(I2str), codeende); fid = fopen(fullfilename, 'w+'); fprintf(fid,"%s\r\n",code); fid = fclose(fid);