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