For some reason when fi == 1, NPV_list(1,1) is inserted correctly, but when fi=2 the value gets overwritten, which i dont understand… at all. This is the code:
clear all;clc;Fi = [0,0.8:0.05:1];T = 160;NPV_list = NaN(length(Fi),1);for fi = 1:length(Fi); fi F = Fi(fi); load (['res_us_v15_',num2str(T),'_',num2str(100*F)]) NPV_list(fi,1) = us.sim.NPV_Pb_Wlth_avg clearvars -except NPV_list Fi T;end
Can someone explain this? This is the output for first 2 iterations:
fi = 1 NPV_list = 9.9570 NaN NaN NaN NaN NaN fi = 2 NPV_list = 9.8664 NaN NaN NaN NaN NaN
Best Answer