matlab把画y=1和y=x*x画在一张图.其中, y的范围在0到1之间,x的范围在0到根号y之间
第1个回答 2018-02-17
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/a50f4bfbfbedab64f6c98bfcfb36afc379311e57?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_600%2Ch_800%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)
clear
clc
close all
%%
t=-1:.1:1;
y=1;
y1=t.*t;
plot(t,y,'ro',t,y1,'b*')
legend('y=1','y=x.*x')
grid on
相似回答
matlab用plot画图时,人为的设置坐标轴的范围:答:使用 axis([XMIN XMAX YMIN YMAX]) ,对于不需要设置范围的轴,使用参数-inf,inf,即正负无穷之间 示例代码:>> x = 1:10;>> y = x.^2;>> subplot(3,1,1)>> plot(x,y,'r')>> subplot(3,1,2)>> plot(x,y,'g')>> xlim([0,15])>> subplot(3,1,3)>> plot(x,y,'...