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

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初等数学 についてさらに検索

タグ

質問済み:

2022 年 11 月 22 日

回答済み:

2022 年 11 月 22 日

Community Treasure Hunt

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

Start Hunting!