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

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)
把这些随机点按先后顺序连接起来,输出图像

 Akzeptierte Antwort

libew
libew am 22 Nov. 2022

0 Stimmen

帮你修改了一下程序供参考
%% 清空环境变量
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--')
运行结果如图

Weitere Antworten (0)

Kategorien

Mehr zu 初等数学 finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 22 Nov. 2022

Beantwortet:

am 22 Nov. 2022

Community Treasure Hunt

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

Start Hunting!