代码
clc;clear;figure('numbertitle','off','name','麦克斯韦速率分布');
global K T m;K=10;T=300;V=0:0.01:32;
for m=50:50:250;subplot(1,2,1);
FF1=4*pi*(m/(2*pi*K*T)).^(3/2);
FF2=V.^2;FF3=exp(-m*V.^2/(2*K*T));% 坐标轴美化
FF=FF1*FF2.*FF3;plot(V,FF,'linewidth',2.5);hold on;
legend('m=50','m=100','m=150','m=200','m=250');
box on;grid on;grid on;set(gca,'linewidth',1.5);
title('麦克斯韦速率分布关系 图一');%加坐标边框加网格线
set(gca,'XGrid', 'off', 'YGrid', 'off', ...
'TickDir', 'in', 'TickLength', [.015 .015], ...
'XMinorTick', 'on', 'YMinorTick', 'on', ...
'XColor', [.1 .1 .1], 'YColor',[.1 .1 .1]);end
for m=50:50:250;subplot(1,2,2);
FF1=4*pi*(m/(2*pi*K*T)).^(3/2);
FF2=V.^2;FF3=exp(-m*V.^2/(2*K*T));
FF=FF1*FF2.*FF3;area(V,FF);hold on;% 坐标轴美化
legend('m=50','m=100','m=150','m=200','m=250');
box on;grid on;grid on;set(gca,'linewidth',1.5);
title('麦克斯韦速率分布关系 图二');%加坐标边框加网格线
set(gca,'XGrid', 'off', 'YGrid', 'off', ...
'TickDir', 'in', 'TickLength', [.015 .015], ...
'XMinorTick', 'on', 'YMinorTick', 'on', ...
'XColor', [.1 .1 .1], 'YColor',[.1 .1 .1]);end