fplot taking too long. any suggestions?

9 vues (au cours des 30 derniers jours)
Ahmed Menouni
Ahmed Menouni le 5 Oct 2018
Hello everyone, i am trying to plot the following function in MATLAB2017a but it is taking way too long (over 12 hours and still nothing). measure and support are 10000*1 and 1*10000 double respectively. Any suggestions? the step before fplot takes ony few minutes..
opengl software
syms t
T0=1;
density(t)=((support.*(normpdf((support-psi(t))/sqrt(t)))*measure)/((normpdf((support-psi(t))/sqrt(t)))*measure))*(normpdf(psi(t)/sqrt(t))/(2*t^(3/2)));
fplot(density,[0 T0],'-k')
function y=psi(t)
y=(log(12/10)+0.5.*0.1.^2.*t-0.1.*t-0.05.*(1-exp(-t)))./0.1;
end

Réponse acceptée

Walter Roberson
Walter Roberson le 5 Oct 2018
fplot() does a lot of adaptive work and discontinuity detection work that can be a waste of time when you just want to see what the plot looks like. When you get into more complicated functions, it is common that what you should do is linspace() up a bunch of points and evaluate the function at the points and plot the results. You can start with lower number of points and increase the number according to how much time you are willing to spend and how "bumpy" the plot lots.

Plus de réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by