Info

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

please, how ( index logical work in matlab ) ?

조회 수: 1 (최근 30일)
Dodo
Dodo 2020년 10월 25일
마감: MATLAB Answer Bot 2021년 8월 20일
in solvig for example question for f2 (x) function in the range of [-2,5] and so on.

답변 (1개)

drummer
drummer 2020년 10월 25일
편집: drummer 2020년 10월 25일
MATLAB does not accept negative indexes if you want to walk through your range. It also starts @ 1.
One workaround you can should be:
idx = -3;
for i = 1 : 7
idx = idx + 1
% then you apply your idx into your f2(idx) down here.
end
Cheers

Community Treasure Hunt

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

Start Hunting!

Translated by