Everytime I run specific fplot function, for some reason my entire matlab program freezes. If I run anything else, it works just fine. Why does this happen?

1 次查看(过去 30 天)
syms t(y)
t(y) = (3.8e6)/(16.1070*1.466*y)*((6.9607*y*95.2e6)/(3.8e6*(6.9607*(1-y)-1)))^(1-y)
fplot(t(y))

回答(1 个)

Walter Roberson
Walter Roberson 2017-9-21
You need to control the bounds. For all y values less than 0, the expression is complex; and for all y values greater than 59607/69607, the expression is complex except at integers.
fplot() with default bounds is spending a lot of time trying to figure out where the real-valued locations are in order to plot them.
  2 个评论
Henn
Henn 2017-9-21
编辑:Henn 2017-9-21
I know its not in my code but I have limited these boundaries to 0.5<y<0.85, and it still does the same thing for some reason.
This is what my code looks like, and it just keeps on running for like an hour and still nothing. I end up having to close matlab and restart it.
syms t(y)
t(y) = (3.8e6)/(16.1070*1.466*y)*((6.9607*y*95.2e6)/(3.8e6*(6.9607*(1-y)-1)))^(1-y)
fplot(t(y),[0.5 0.85])
Walter Roberson
Walter Roberson 2017-9-21
I am not sure. I know that fplot does a lot of background processing looking for discontinuities, but there should not be any in that range.
In the meantime, switch to ezplot

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Assumptions 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by