首发公众号:120701101。
从自学者的角度讲起。如果感兴趣,可以及时关注,咱们一起进步。
公众号中可以获取大量的学习资料。
一、代码
% 创建局部放大图
syms x
f = 1/(1 + x^2) + 1/(1 + 10*[1 + 10*(3-x)]^2);
fig = gcf;
ax1 = axes('Position', [0.15 0.15 0.7 0.7]);
ax2 = axes('Position',[0.55 0.5 0.28 0.28]);
axes(ax1)
ax1.XLim = [-4, 12];
ax1.YLim = [0, 1.2];
hold on
p1 = fplot(f);
p1.LineWidth = 1;
p1.Color = 'r';
p2 = plot([2.5, 2.5], [0, 0.3]);
p2.LineStyle = ":";
p2.Color = 'k';
p3 = plot([3.5, 3.5], [0, 0.3]);
p3.LineStyle = ":";
p3.Color = 'k';
xlabel('$$ x $$', 'interpreter', 'la