Filter löschen
Filter löschen

help in doing forward and backward difference...

1 Ansicht (letzte 30 Tage)
sri satya ravi
sri satya ravi am 2 Sep. 2016
Beantwortet: KSSV am 2 Sep. 2016
dv_dteta = zeros (length(crank_angle),1)
for j = 1:1:length(crank_angle-1) dv_dteta = (s(j+1)-s(j))./(crank_angle(j+1)-crank_angle(j)); end
when i write this i get an error code saying Index exceeds matrix dimensions.
the crank angle is a array of 300 data points.
is there a way to do a backward difference for the first point and the rest forward difference to match the dimensions???

Akzeptierte Antwort

KSSV
KSSV am 2 Sep. 2016
You must use
j = 1:length(crank_angle)-1
rather then
j = 1:1:length(crank_angle-1)

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by