matlab 将产生的随机点连接起来如:for a=1:1:10b=1+9*rand;plot(a,b,'-+');hold onend

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/13 07:43:45
matlab 将产生的随机点连接起来如:for a=1:1:10b=1+9*rand;plot(a,b,'-+');hold onend

matlab 将产生的随机点连接起来如:for a=1:1:10b=1+9*rand;plot(a,b,'-+');hold onend
matlab 将产生的随机点连接起来
如:
for a=1:1:10
b=1+9*rand;
plot(a,b,'-+');
hold on
end

matlab 将产生的随机点连接起来如:for a=1:1:10b=1+9*rand;plot(a,b,'-+');hold onend
你的想法是好的,打印出随机点没问题;但是若想同时打点与连线就得换个思路.
-------------------------------------
clc;clear;close
b=[];
for a=1:1:10
b=[b 1+9*rand];
end
a=1:10;
plot(a,b,'-+');
-----------------------------------------
另外对于你的问题补充,让人实在感到不舒服,你可以想想为什么被浏览22次都没人回答.