Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Subscript indices must either be real positive integers or logicals.

조회 수: 1 (최근 30일)
Mo Das
Mo Das 2019년 6월 3일
마감: MATLAB Answer Bot 2021년 8월 20일
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 ; %part 1
PVbiSum = [sum(PVbi(2:end,1:numel(duration)))];
EV = BAC .* PC ; % part2
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)) ;
sum(EV(2:end,17:20)) ;sum(EV(2:end,21:24))];
  댓글 수: 6
Alex Mcaulley
Alex Mcaulley 2019년 6월 3일
Your code should work with the data you specified. Please upload all your variables in a mat file to see what is happening.
Mo Das
Mo Das 2019년 6월 3일
yeah it works . the problem was other codes beetwen them . thx

답변 (0개)

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by