作者zupo (朝着目标前进)
标题Re: [讨论]plot 作图 但图跑不出来
时间Sun Mar 11 23:13:32 2018
※ 引述《sikao (si)》之铭言:
: 版上前辈大家好 再请教一个问题
: 我用plot指令作图 但图就跑不出来
: 想请问一下是甚麽原因
: 我写的script如下
: for t=0:0.05:5
: T=170-22*t
: if T>=120
: G=(3.98*10^7)*exp(-6270/(8.314*(T-30)))*exp(-2.55*10^5/((T+273)*(200-T)))
: else
: G=(4.81*10^11)*exp(-6270/(8.314*(T-30)))*exp(-5.51*10^5/((T+273)*(200-T)))
: end
: plot(t,G);
: axis([0,5,10^-5,5]);
: xlabel('Time');
: ylabel('G (min^-1)')
: end
: 不知道是不是要调整y轴的范围
: 麻烦大家非常谢谢
改写如下
function activiteng
clc
format long
t=0:0.05:5;
T = 170-22.*t;
if T >= 120
G
=(3.98.*10^7).*exp(-6270./(8.314.*(T-30))).*exp(-2.55.*10^5./((T+273).*(200-T)))
else
G
=(4.81.*10^11).*exp(-6270./(8.314.*(T-30))).*exp(-5.51.*10^5./((T+273).*(200-T)))
end
plot(t,G);
axis([0,5,10^-5,5]);
xlabel('Time');
ylabel('G (min^-1)')
这样应该可行
--
1.MATLAB programming 2.ASPEN process simulation package
3.FORTRN programming 4.Advance Engineering Mathematics
5.Process Control Theory
6.Chemical Engineering Basic Theory(Kinetic.thermodynamics.transport)
7.Numerical Method and Analysis
8.MATLAB Toolbox.Simulink system basic design
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 14.188.137.148
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/MATLAB/M.1520781219.A.DD8.html