Problem with plot in interval
1 次查看(过去 30 天)
显示 更早的评论
I have a problem with this code:
When i give in input this:
fzer0(@(x)x.^2-4,[0 4])
Matlab give me a good plot.
When i give in input this:
fzer0(@(x)x.^2-4,[0 13])
Matlab give me a wrong plot, the output have not a plot!!
plot(fun(xo(1):0.00001:xo(2)), 'b - ', 'LineWidth', 2.5);
grid on;
yline(0, '--r', 'y = 0');
xlabel('x');
str=func2str(fun); %stringa della funzione
newstr=erase(str(5:end), '.'); %cancella dall'espressione il function handle e cancella il punto
tit=strcat('f = ', newstr);
title(tit);
text(double(m), double(0), strcat( 'x = ', num2str(m) ) );
set(gcf, 'color', 'g');
set(gca, 'FontSize', 9);
3 个评论
Walter Roberson
2019-4-3
Please put everything together in a form that we can run, in order to test your code.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!