怎么把坐标方程的点按时间顺序连接起来。

clc;clear;
for t=0:1:100
x0=0; y0=0;
sub_v=10+(20-10)*rand;
sub_thita=pi/2*rand;
sub_x=x0+sub_v*t*cos(sub_thita)
sub_y=y0+sub_v*t*sin(sub_thita)
把这些随机点按先后顺序连接起来,输出图像

 采纳的回答

libew
libew 2022-11-22

0 个投票

帮你修改了一下程序供参考
%% 清空环境变量
close all; clear; clc;
%% 主程序
t=0:1:100
x0=0; y0=0;
sub_v=10+(20-10)*rand(1,101);
sub_thita=pi/2.*rand(1,101);
sub_x=x0+sub_v.*t.*cos(sub_thita);
sub_y=y0+sub_v.*t.*sin(sub_thita);
figure;
plot(sub_x,sub_y,'ko--')
运行结果如图

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 初等数学 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!