Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

please, how ( index logical work in matlab ) ?

1 Ansicht (letzte 30 Tage)
Dodo
Dodo am 25 Okt. 2020
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
in solvig for example question for f2 (x) function in the range of [-2,5] and so on.

Antworten (1)

drummer
drummer am 25 Okt. 2020
Bearbeitet: drummer am 25 Okt. 2020
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

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by