Creating a code that calculates acceleration simulation

clc
clear all
close all
x = [0, 10, 20, 30, 40, 50]; %time in minutes
y = [0, 60, 120, 280, 150, 40]; %distance travelled in x minutes

답변 (1개)

Johannes Hougaard
Johannes Hougaard 2020년 5월 20일
x = [0, 10, 20, 30, 40, 50]; %time in minutes
y = [0, 60, 120, 280, 150, 40]; %distance travelled in x minutes
xForward = x(1:end-1); % define the domains to perform forward differences for x
yForward = y(1:end-1); % define the domains to perform forward differences for y
diffX = x(2:end) - xForward;
diffY = y(2:end) - yForward;
diff(y) %used to verify the forward difference calculated above

카테고리

도움말 센터File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

질문:

2020년 5월 20일

편집:

2020년 5월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by