MATLAB怎样画出高数课本上的的这些区间示意图

MATLAB怎样画出高数课本上的的这些区间示意图
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
代码:

close all
%% 微信公众号:海洋与大气科学
%% 作者:mapm:QQ:916490285
%% 时间:2022年12月1号
%% 1:双闭区间
figure
set(gcf,'color','w')
scatter(0,0,'o','MarkerEdgeColor','black','MarkerFaceColor','black');
hold on
scatter(1,0,'o','MarkerEdgeColor','black','MarkerFaceColor','black');
hold on
scatter(5,0,'o','MarkerEdgeColor','black','MarkerFaceColor','black');
hold on
annotation('arrow',[0.2 0.8],[0.52 0.52],'LineStyle','-','color',[0 0 0],'HeadStyle','cback3');
hold on
line([1,5],[1,1],'color','k')
hold on
line([1,1],[0,1],'color','k')
hold on
line([5,5],[0,1],'color','k')
axis([-2 8 -10 10])
hold on
for i=1:0.5:4.5
line([i,i+0.5],[0,1],'color','k')
hold on
end
text(0,-1,'O','fontsize',14,'fontweight','bold','fontname','time news roman')
text(1,-1,'a','fontsize',14,'fontweight','bold','fontname','time news roman')
text(5,-1,'b','fontsize',14,'fontweight','bold','fontname','time news roman')
text(6.5,-1,'x','fontsize',14,'fontweight','bold','fontname','time news roman')
text(2,2,'[a,b]','fontsize',14,'fontweight','bold','fontname','time news roman')
set(gca,'xtick',[],'xticklabel',[],'xcolor','w','ytick',[],'yticklabel',[],'ycolor','w')
title('双闭区间','fontsize',14,'fontweight','bold','fontname','黑体')
export_fig('双闭区间.png','-r300')
%% 2:双开区间

figure
set(gcf,'color','w')
scatter(0,0,'o','MarkerEdgeColor','black','MarkerFaceColor','black');
hold on
scatter(1,0,'o','MarkerEdgeColor','black','MarkerFaceColor','w');
hold on
scatter(5,0,'o','MarkerEdgeColor','black','MarkerFaceColor','w');
hold on
annotation('arrow',[0.2 0.8],[0.52 0.52],'LineStyle','-','color',[0 0 0],'HeadStyle','cback3');
hold on
line([1,5],[1,1],'color','k')
hold on
line([1,1],[0,1],'color','k')
hold on
line([5,5],[0,1],'color','k')
axis([-2 8 -10 10])
hold on
for i=1:0.5:4.5
line([i,i+0.5],[0,1],'color','k')
hold on
end
text(0,-1,'O','fontsize',14,'fontweight','bold','fontname','time news roman')
text(1,-1,'a','fontsize',14,'fontweight','bold','fontname','time news roman')
text(5,-1,'b','fontsize',14,'fontweight','bold','fontname','time news roman')
text(6.5,-1,'x','fontsize',14,'fontweight','bold','fontname','time news roman')
text(2,2,'(a,b)','fontsize',14,'fontweight','bold','fontname','time news roman')
set(gca,'xtick',[],'xticklabel',[],'xcolor','w','ytick',[],'yticklabel',[],'ycolor','w')
title('双开区间','fontsize',14,'fontweight','bold','fontname','黑体')
export_fig('双开区间.png','-r300')
%% 3 左开右闭

figure
set(gcf,'color','w')
scatter(0,0,'o','MarkerEdgeColor','black','MarkerFaceColor','black');
hold on
scatter(1,0,'o','MarkerEdgeColor','black','MarkerFaceColor','w');
hold on
scatter(5,0,'o','MarkerEdgeColor','black','MarkerFaceColor','k');
hold on
annotation('arrow',[0.2 0.8],[0.52 0.52],'LineStyle','-','color',[0 0 0],'HeadStyle','cback3');
hold on
line([1,5],[1,1],'color','k')
hold on
line([1,1],[0,1],'color','k')
hold on
line([5,5],[0,1],'color','k')
axis([-2 8 -10 10])
hold on
for i=1:0.5:4.5
line([i,i+0.5],[0,1],'color','k')
hold on
end
text(0,-1,'O','fontsize',14,'fontweight','bold','fontname','time news roman')
text(1,-1,'a','fontsize',14,'fontweight','bold','fontname','time news roman')
text(5,-1,'b','fontsize',14,'fontweight','bold','fontname','time news roman')
text(6.5,-1,'x','fontsize',14,'fontweight','bold','fontname','time news roman')
text(2,2,'(a,b]','fontsize',14,'fontweight','bold','fontname','time news roman')
set(gca,'xtick',[],'xticklabel',[],'xcolor','w','ytick',[],'yticklabel',[],'ycolor','w')
title('左开右闭','fontsize',14,'fontweight','bold','fontname','黑体')
export_fig('左开右闭.png','-r300')
%% 4 左闭右开

figure
set(gcf,'color','w')
scatter(0,0,'o','MarkerEdgeColor','black','MarkerFaceColor','black');
hold on
scatter(1,0,'o','MarkerEdgeColor','black','MarkerFaceColor','k');
hold on
scatter(5,0,'o','MarkerEdgeColor','black','MarkerFaceColor','w');
hold on
annotation('arrow',[0.2 0.8],[0.52 0.52],'LineStyle','-','color',[0 0 0],'HeadStyle','cback3');
hold on
line([1,5],[1,1],'color','k')
hold on
line([1,1],[0,1],'color','k')
hold on
line([5,5],[0,1],'color','k')
axis([-2 8 -10 10])
hold on
for i=1:0.5:4.5
line([i,i+0.5],[0,1],'color','k')
hold on
end
text(0,-1,'O','fontsize',14,'fontweight','bold','fontname','time news roman')
text(1,-1,'a','fontsize',14,'fontweight','bold','fontname','time news roman')
text(5,-1,'b','fontsize',14,'fontweight','bold','fontname','time news roman')
text(6.5,-1,'x','fontsize',14,'fontweight','bold','fontname','time news roman')
text(2,2,'[a,b)','fontsize',14,'fontweight','bold','fontname','time news roman')
set(gca,'xtick',[],'xticklabel',[],'xcolor','w','ytick',[],'yticklabel',[],'ycolor','w')
title('左闭右开','fontsize',14,'fontweight','bold','fontname','黑体')
export_fig('左闭右开.png','-r300')



  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

海洋与大气科学

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值