matlab怎么画含有参数的函数图像?
发布网友
发布时间:2022-04-30 20:46
我来回答
共4个回答
热心网友
时间:2023-10-11 18:29
>> syms k
>> t=0:0.1:100;
>> H=exp(-k*t)-20*k;
>> ezplot(H)
Error using inlineeval (line 15)
Error in inline expression ==> matrix([[1 -
20.*k, exp(-k./10) - 20.*k, exp(-k./5) -
20.*k, exp(-(3.*k)./10) - 20.*k,
exp(-(2.*k)./5) - 20.*k, exp(-k./2) -
20.*k, exp(-(3.*k)./5) - 20.*k,
exp(-(7.*k)./10) - 20.*k, exp(-(4.*k)./5) -
20.*k, exp(-(9.*k)./10) - 20.*k, exp(-k) -
20.*k, exp(-(11.*k)./10) - 20.*k,
exp(-(6.*k)./5) - 20.*k, exp(-(13.*k)./10)
- 20.*k, exp(-(7.*k)./5) - 20.*k,
exp(-(3.*k)./2) - 20.*k, exp(-(8.*k)./5) -
20.*k, exp(-(17.*k)./10) - 20.*k,
exp(-(9.*k)./5) - 20.*k, exp(-(19.*k)./10)
- 20.*k, exp(-2.*k) - 20.*k,
exp(-(21.*k)./10) - 20.*k, exp(-(11.*k)./5)
- 20.*k, exp(-(23.*k)./10) - 20.*k,
exp(-(12.*k)./5) - 20.*k, exp(-(5.*k)./2) -
20.*k, exp(-(13.*k)./5) - 20.*k,
exp(-(27.*k)./10) - 20.*k, exp(-(14.*k)./5)
- 20.*k, exp(-(29.*k)./10) - 20.*k,
exp(-3.*k) - 20.*k, exp(-(31.*k)./10) -
20.*k, exp(-(16.*k)./5) - 20.*k,
exp(-(33.*k)./10) - 20.*k, exp(-(17.*k)./5)
- 20.*k, exp(-(7.*k)./2) - 20.*k,
exp(-(18.*k)./5) - 20.*k, exp(-(37.*k)./10)
- 20.*k, exp(-(19.*k)./5) - 20.*k,
exp(-(39.*k)./10) - 20.*k, exp(-4.*k) -
20.*k, exp(-(41.*k)./10) - 20.*k,
exp(-(21.*k)./5) - 20.*k, exp(-(43.*k)./10)
- 20.*k, exp(-(22.*k)./5) - 20.*k,
exp(-(9.*k)./2) - 20.*k, exp(-(23.*k)./5) -
20.*k, exp(-(47.*k)./10) - 20.*k,
exp(-(24.*k)./5) - 20.*k, exp(-(49.*k)./10)
- 20.*k, exp(-5.*k) - 20.*k,
exp(-(51.*k)./10) - 20.*k, exp(-(26.*k)./5)
- 20.*k, exp(-(53.*k)./10) - 20.*k,
exp(-(27.*k)./5) - 20.*k, exp(-(11.*k)./2)
- 20.*k, exp(-(28.*k)./5) - 20.*k,
exp(-(57.*k)./10) - 20.*k, exp(-(29.*k)./5)
- 20.*k, exp(-(59.*k)./10) - 20.*k,
exp(-6.*k) - 20.*k, exp(-(61.*k)./10) -
20.*k, exp(-(31.*k)./5) - 20.*k,
exp(-(63.*k)./10) - 20.*k, exp(-(32.*k)./5)
- 20.*k, exp(-(13.*k)./2) - 20.*k,
exp(-(33.*k)./5) - 20.*k, exp(-(67.*k)./10)
- 20.*k, exp(-(34.*k)./5) - 20.*k,
exp(-(69.*k)./10) - 20.*k, exp(-7.*k) -
20.*k, exp(-(71.*k)./10) - 20.*k,
exp(-(36.*k)./5) - 20.*k, exp(-(73.*k)./10)
- 20.*k, exp(-(37.*k)./5) - 20.*k,
exp(-(15.*k)./2) - 20.*k, exp(-(38.*k)./5)
- 20.*k, exp(-(77.*k)./10) - 20.*k,
exp(-(39.*k)./5) - 20.*k, exp(-(79.*k)./10)
- 20.*k, exp(-8.*k) - 20.*k,
exp(-(81.*k)./10) - 20.*k, exp(-(41.*k)./5)
- 20.*k, exp(-(83.*k)./10) - 20.*k,
exp(-(42.*k)./5) - 20.*k, exp(-(17.*k)./2)
- 20.*k, exp(-(43.*k)./5) - 20.*k,
exp(-(87.*k)./10) - 20.*k, exp(-(44.*k)./5)
- 20.*k, exp(-(89.*k)./10) - 20.*k,
exp(-9.*k) - 20.*k, exp(-(91.*k)./10) -
20.*k, exp(-(46.*k)./5) - 20.*k,
exp(-(93.*k)./10) - 20.*k, exp(-(47.*k)./5)
- 20.*k, exp(-(19.*k)./2) - 20.*k,
exp(-(48.*k)./5) - 20.*k, exp(-(97.*k)./10)
- 20.*k, exp(-(49.*k)./5) - 20.*k,
exp(-(99.*k)./10) - 20.*k, exp(-10.*k) -
20.*k, exp(-(101.*k)./10) - 20.*k,
exp(-(51.*k)./5) - 20.*k,
exp(-(103.*k)./10) - 20.*k,
exp(-(52.*k)./5) - 20.*k, exp(-(21.*k)./2)
- 20.*k, exp(-(53.*k)./5) - 20.*k,
exp(-(107.*k)./10) - 20.*k,
exp(-(54.*k)./5) - 20.*k,
exp(-(109.*k)./10) - 20.*k, exp(-11.*k) -
20.*k, exp(-(111.*k)./10) - 20.*k,
exp(-(56.*k)./5) - 20.*k,
exp(-(113.*k)./10) - 20.*k,
exp(-(57.*k)./5) - 20.*k, exp(-(23.*k)./2)
- 20.*k, exp(-(58.*k)./5) - 20.*k,
exp(-(117.*k)./10) - 20.*k,
exp(-(59.*k)./5) - 20.*k,
exp(-(119.*k)./10) - 20.*k, exp(-12.*k) -
20.*k, exp(-(121.*k)./10) - 20.*k,
exp(-(61.*k)./5) - 20.*k,
exp(-(123.*k)./10) - 20.*k,
exp(-(62.*k)./5) - 20.*k, exp(-(25.*k)./2)
- 20.*k, exp(-(63.*k)./5) - 20.*k,
exp(-(127.*k)./10) - 20.*k,
exp(-(64.*k)./5) - 20.*k,
exp(-(129.*k)./10) - 20.*k, exp(-13.*k) -
20.*k, exp(-(131.*k)./10) - 20.*k,
exp(-(66.*k)./5) - 20.*k,
exp(-(133.*k)./10) - 20.*k,
exp(-(67.*k)./5) - 20.*k, exp(-(27.*k)./2)
- 20.*k, exp(-(68.*k)./5) - 20.*k,
exp(-(137.*k)./10) - 20.*k,
exp(-(69.*k)./5) - 20.*k,
exp(-(139.*k)./10) - 20.*k, exp(-14.*k) -
20.*k, exp(-(141.*k)./10) - 20.*k,
exp(-(71.*k)./5) - 20.*k,
exp(-(143.*k)./10) - 20.*k,
exp(-(72.*k)./5) - 20.*k, exp(-(29.*k)./2)
- 20.*k, exp(-(73.*k)./5) - 20.*k,
exp(-(147.*k)./10) - 20.*k,
exp(-(74.*k)./5) - 20.*k,
exp(-(149.*k)./10) - 20.*k, exp(-15.*k) -
20.*k, exp(-(151.*k)./10) - 20.*k,
exp(-(76.*k)./5) - 20.*k,
exp(-(153.*k)./10) - 20.*k,
exp(-(77.*k)./5) - 20.*k, exp(-(31.*k)./2)
- 20.*k, exp(-(78.*k)./5) - 20.*k,
exp(-(157.*k)./10) - 20.*k,
exp(-(79.*k)./5) - 20.*k,
exp(-(159.*k)./10) - 20.*k, exp(-16.*k) -
20.*k, exp(-(161.*k)./10) - 20.*k,
exp(-(81.*k)./5) - 20.*k,
exp(-(163.*k)./10) - 20.*k,
exp(-(82.*k)./5) - 20.*k, exp(-(33.*k)./2)
- 20.*k, exp(-(83.*k)./5) - 20.*k,
exp(-(167.*k)./10) - 20.*k,
exp(-(84.*k)./5) - 20.*k,
exp(-(169.*k)./10) - 20.*k, exp(-17.*k) -
20.*k, exp(-(171.*k)./10) - 20.*k,
exp(-(86.*k)./5) - 20.*k,
exp(-(173.*k)./10) - 20.*k,
exp(-(87.*k)./5) - 20.*k, exp(-(35.*k)./2)
- 20.*k, exp(-(88.*k)./5) - 20.*k,
exp(-(177.*k)./10) - 20.*k,
exp(-(89.*k)./5) - 20.*k,
exp(-(179.*k)./10) - 20.*k, exp(-18.*k) -
20.*k, exp(-(181.*k)./10) - 20.*k,
exp(-(91.*k)./5) - 20.*k,
exp(-(183.*k)./10) - 20.*k,
exp(-(92.*k)./5) - 20.*k, exp(-(37.*k)./2)
- 20.*k, exp(-(93.*k)./5) - 20.*k,
exp(-(187.*k)./10) - 20.*k,
exp(-(94.*k)./5) - 20.*k,
exp(-(189.*k)./10) - 20.*k, exp(-19.*k) -
20.*k, exp(-(191.*k)./10) - 20.*k,
exp(-(96.*k)./5) - 20.*k,
exp(-(193.*k)./10) - 20.*k,
exp(-(97.*k)./5) - 20.*k, exp(-(39.*k)./2)
- 20.*k, exp(-(98.*k)./5) - 20.*k,
exp(-(197.*k)./10) - 20.*k,
exp(-(99.*k)./5) - 20.*k,
exp(-(199.*k)./10) - 20.*k, exp(-20.*k) -
20.*k, exp(-(201.*k)./10) - 20.*k,
exp(-(101.*k)./5) - 20.*k,
exp(-(203.*k)./10) - 20.*k,
exp(-(102.*k)./5) - 20.*k, exp(-(41.*k)./2)
- 20.*k, exp(-(103.*k)./5) - 20.*k,
exp(-(207.*k)./10) - 20.*k,
exp(-(104.*k)./5) - 20.*k,
exp(-(209.*k)./10) - 20.*k, exp(-21.*k) -
20.*k, exp(-(211.*k)./10) - 20.*k,
exp(-(106.*k)./5) - 20.*k,
exp(-(213.*k)./10) - 20.*k,
exp(-(107.*k)./5) - 20.*k, exp(-(43.*k)./2)
- 20.*k, exp(-(108.*k)./5) - 20.*k,
exp(-(217.*k)./10) - 20.*k,
exp(-(109.*k)./5) - 20.*k,
exp(-(219.*k)./10) - 20.*k, exp(-22.*k) -
20.*k, exp(-(221.*k)./10) - 20.*k,
exp(-(111.*k)./5) - 20.*k,
exp(-(223.*k)./10) - 20.*k,
exp(-(112.*k)./5) - 20.*k, exp(-(45.*k)./2)
- 20.*k, exp(-(113.*k)./5) - 20.*k,
exp(-(227.*k)./10) - 20.*k,
exp(-(114.*k)./5) - 20.*k,
exp(-(229.*k)./10) - 20.*k, exp(-23.*k) -
20.*k, exp(-(231.*k)./10) - 20.*k,
exp(-(116.*k)./5) - 20.*k,
exp(-(233.*k)./10) - 20.*k,
exp(-(117.*k)./5) - 20.*k, exp(-(47.*k)./2)
- 20.*k, exp(-(118.*k)./5) - 20.*k,
exp(-(237.*k)./10) - 20.*k,
exp(-(119.*k)./5) - 20.*k,
exp(-(239.*k)./10) - 20.*k, exp(-24.*k) -
20.*k, exp(-(241.*k)./10) - 20.*k,
exp(-(121.*k)./5) - 20.*k,
exp(-(243.*k)./10) - 20.*k,
exp(-(122.*k)./5) - 20.*k, exp(-(49.*k)./2)
- 20.*k, exp(-(123.*k)./5) - 20.*k,
exp(-(247.*k)./10) - 20.*k,
exp(-(124.*k)./5) - 20.*k,
exp(-(249.*k)./10) - 20.*k, exp(-25.*k) -
20.*k, exp(-(251.*k)./10) - 20.*k,
exp(-(126.*k)./5) - 20.*k,
exp(-(253.*k)./10) - 20.*k,
exp(-(127.*k)./5) - 20.*k, exp(-(51.*k)./2)
- 20.*k, exp(-(128.*k)./5) - 20.*k,
exp(-(257.*k)./10) - 20.*k,
exp(-(129.*k)./5) - 20.*k,
exp(-(259.*k)./10) - 20.*k, exp(-26.*k) -
20.*k, exp(-(261.*k)./10) - 20.*k,
exp(-(131.*k)./5) - 20.*k,
exp(-(263.*k)./10) - 20.*k,
exp(-(132.*k)./5) - 20.*k, exp(-(53.*k)./2)
- 20.*k, exp(-(133.*k)./5) - 20.*k,
exp(-(267.*k)./10) - 20.*k,
exp(-(134.*k)./5) - 20.*k,
exp(-(269.*k)./10) - 20.*k, exp(-27.*k) -
20.*k, exp(-(271.*k)./10) - 20.*k,
exp(-(136.*k)./5) - 20.*k,
exp(-(273.*k)./10) - 20.*k,
exp(-(137.*k)./5) - 20.*k, exp(-(55.*k)./2)
- 20.*k, exp(-(138.*k)./5) - 20.*k,
exp(-(277.*k)./10) - 20.*k,
exp(-(139.*k)./5) - 20.*k,
exp(-(279.*k)./10) - 20.*k, exp(-28.*k) -
20.*k, exp(-(281.*k)./10) - 20.*k,
exp(-(141.*k)./5) - 20.*k,
exp(-(283.*k)./10) - 20.*k,
exp(-(142.*k)./5) - 20.*k, exp(-(57.*k)./2)
- 20.*k, exp(-(143.*k)./5) - 20.*k,
热心网友
时间:2023-10-11 18:29
clear
clc
t=(0:0.1:24)
for i=1:length(t)
tt=t(i)
fun=strcat('lognpdf(',num2str(tt),',log(1.61)+log(0.15)-log(p)+3.2,0.88)')
y(i)=quadl(inline(fun),2,3)
end
plot(t,y)
或者
clc
clear
syms p f
i=1;
for x=0:0.1:24
f=(1/(1.61*0.15))*(((1.61*0.15)/(x*0.88*sqrt(2*pi)))*exp(-(log(x)-log(1.61)-log(0.15)+log(p)-3.20).^2/(2*0.88*0.88)));
y(i)=quadl(inline(f),2,3);
i=i+1;
end
plot([0:0.1:24],y)
热心网友
时间:2023-10-11 18:29
用ezplot画图
热心网友
时间:2023-10-11 18:30
嗯,同一一楼