'Error - Array indices must be positive integers or logical values
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Harrison Dove
am 9 Aug. 2020
Beantwortet: Walter Roberson
am 9 Aug. 2020
Hey could anyone help me to figure out why i would be getting this error?

0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 9 Aug. 2020
t1 = 0;
t2 = 0.04;
So t2-t1 is 0.04 - 0 = 0.04
x_2 = v_x1(t2-t1)+x_1
That code attempts to index v_x1 at location t2-t1 which is v_x1 at index 0.04 which is not valid.
Reminder: MATLAB has absolutely no implied multiplication. None . Not even in the Symbolic Engine. If you want to multiply v_x1 by something then you need .* or * as appropriate.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!