help in doing forward and backward difference...
조회 수: 1 (최근 30일)
이전 댓글 표시
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???
댓글 수: 0
채택된 답변
KSSV
2016년 9월 2일
You must use
j = 1:length(crank_angle)-1
rather then
j = 1:1:length(crank_angle-1)
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!