如何用MATLAB画y=a+b*e^x图像

其中a b都是已知数,b*e^x为b乘以e的x次方
举例如:y=1+2*e^x
请写出程序哈
如果要定义x=0时 为8:30 x=1时为9:30 怎么做
如果把X=0时Y设为最大。x轴表示时间,y表示温度该怎么做呢?

a = 1;
b = 2;
x = -10:0.1:1;
y = a+b.*exp(x);
plot(x,y)

...........

ezplot('1+2*exp(x)',[-5,1])追问

如果要定义x=0时 为8:30 x=1时为9:30 怎么做

追答

a = 1;
b = 2;
x = 0:0.1:1;
y = a+b.*exp(x);
plot(x,y)
set(gca,'XTickLabel',{'8:30' '' '' '' '' '9:30'})

...

a = 1;
b = 2;
x = -1:0.1:2;
y = a+b.*exp(x);
plot(x,y)
set(gca,'XTickLabel',{ '' '' '8:30' '' '9:30' '' '' })

参考资料:http://hi.baidu.com/zzz700/blog/item/1f6d85feb1b808086d22eb03.html

追问

不好意思,最后一个问,如果把X=0时Y设为最大。x轴表示时间,y表示温度该怎么做呢?如果是乘以e的-0.12x次方呢

追答

a = 1;
b = 2;
x = 0:0.1:2;
y = a+b.*exp(-0.12*x);
plot(x,y)
xlabel( '时间' );
ylabel( '温度' );

温馨提示:答案为网友推荐,仅供参考