2014-11-08 44 views
0

我想要繪製匿名功能,但它給了我錯誤:由於錯誤消息指出尺寸混淆在一起不能畫出匿名函數在Matlab中

>> [email protected](t) (3*t)/(exp(1)-(8.*t))-2/t.^2; 
>> x=linspace(-3,1,50); 
>> plot(x, f(x)) 
Error using/
Matrix dimensions must agree. 

Error in @(t)(3*t)/(exp(1)-(8.*t))-2/t.^2 

回答

2

。要完全矢量化的功能:

[email protected](t) (3*t)./(exp(1)-(8.*t))-2./t.^2; 
x=linspace(-3,1,50); 
plot(x, f(x)) 

這裏是結果,這是你在找什麼?: enter image description here