hi friends. i have this code . when i execute first or second part in seprate script , it works and gives me answer . but when i execute both of them in one script and after each other it shows me that error .
*Subscript indices must either be real positive integers or logicals.
what should i do?
PVbi = BAC .* PCBreakEven ;
PVbiSum = [sum(PVbi(2:end,1:numel(duration)))];
EV = BAC .* PC ;
SigmaEV = [sum(EV(2:end,1:4)) ;sum(EV(2:end,5:8)) ;
sum(EV(2:end,9:12)) ;sum(EV(2:end,13:16)) ;