You are on page 1of 1

pow_axial={}

for cycle_nr in range(1,num_cycles):


pow_axial[cycle_nr]=[[],[],[]]
pow_radial={}
for cycle_nr in range(1,num_cycles):
pow_radial[cycle_nr]=[[],[],[]]
for cycle_nr in range(1,num_cycles):
for cycle_phase in range(0,3): # BOC, MOC, or EOC
os.chdir("{PATH}") # change {PATH} with C:\...\MAIN FOLDER\
cwd = os.getcwd()
print("current working directory" + cwd)
folder_phase = "phase_" + str(cycle_nr)
file_output = folder_phase + "/ESFR_phase" + str(cycle_nr)+"_core"+ str(cycle_phase) + ".m"
print("Reading output file: ")

pow_axial={}
for cycle_nr in range(1,num_cycles):
pow_axial[cycle_nr]=[[],[],[]]
pow_radial={}
for cycle_nr in range(1,num_cycles):
pow_radial[cycle_nr]=[[],[],[]]
for cycle_nr in range(1,num_cycles):
for cycle_phase in range(0,3): # BOC, MOC, or EOC
os.chdir("{PATH}") # change {PATH} with C:\...\MAIN FOLDER\
cwd = os.getcwd()
print("current working directory" + cwd)
folder_phase = "phase_" + str(cycle_nr)
file_output = folder_phase + "/ESFR_phase" + str(cycle_nr)+"_core"+ str(cycle_phase) + ".m"
print("Reading output file: ")
print(" " + file_output)
f = open(file_output,'r') # open the matlab file in read mode
lines = f.readlines() # store lines of matlab file in a list called lists
f.close() # close the file

for x in range(3,15): #
pow_radial[cycle_nr][cycle_phase].append(lines[x])
for x in range(33,254): #
pow_axial[cycle_nr][cycle_phase].append(lines[x])

print(" " + file_output)


f = open(file_output,'r') # open the matlab file in read mode
lines = f.readlines() # store lines of matlab file in a list called lists
f.close() # close the file

for x in range(3,15): #
pow_radial[cycle_nr][cycle_phase].append(lines[x])
for x in range(33,254): #
pow_axial[cycle_nr][cycle_phase].append(lines[x])

You might also like