0

作为示例,我使用 x 和 y 轴在 MATLAB 中创建了以下数据:

t = 1:5    % time in seconds

dxx = [10,8,6,5,4] % speed in x direction
w = trapz(t,dxx)   % distance object in x direction (numerical integration)

dyy = [9,7,6,5,3]  % speed in y direction
c = trapz(t,dyy)   % distance of object in y direction (numerical integration)

如何仅使用此数据绘制向量 dxx(t) vs dyy(t)(时间 t 的净轨迹)?

4

1 回答 1

0

首先,我假设您需要cumtrapz而不是trapz. 对于绘图,您可以使用quiver

t = 1:5    % time in seconds

dxx = [10,8,6,5,4] % speed in x direction
w = cumtrapz(t,dxx)   % distance object in x direction (numerical integration)

dyy = [9,7,6,5,3]  % speed in y direction
c = cumtrapz(t,dyy)   % distance of object in y direction (numerical integration)

quiver(w,c,dxx,dyy)

导致:

在此处输入图像描述

是你要找的吗?

于 2014-03-10T09:43:56.573 回答