求助:matlab中用plot函数画图,怎么没有出现曲线啊,下面是程序,希望哪位大侠帮我看一下
clc;
%%%%%%%%%%%%%%%%%%%%%
%plot your figure before
%%%%%%%%%%%%%%%%%%%%%
% figure resize
set(gcf,'Position',[100 100 336 264]);
set(gca,'Position',[.165 .17 .80 .74]);
figure_FontSize=9;
set(get(gca,'XLabel'),'FontSize',figure_FontSize,'Vertical','top');
set(get(gca,'YLabel'),'FontSize',figure_FontSize,'Vertical','middle');
set(findobj('FontSize',10),'FontSize',figure_FontSize);
set(findobj(get(gca,'Children'),'LineWidth',0.5),'LineWidth',2);
% 输入参数区%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
S=0.27;% 饱和体积含水量
R=0.081;% 残余体积含水量;%浸润时的残余体积含水量
d1=4.2;
b1=1.75;% 浸润边界的参数
d2=6.1;
b2=2.49;% 干燥边界的参数
G=[3 2.55 2.2 1.7];
C=20;% 韦昌富参数
Pc=ones(1,75);%定义一个有100个元素的矩阵,用来装吸力
W=ones(1,75);% 定义一个有100个元素的矩阵,用来装体积含水量%%%%%本文方法扫描线计算段%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Wet=ones(1,75);
Dry=ones(1,75);
Pc(1)=3;% 定义第一个反弯点的数值
for i=1:75
Pc(i)=Pc(i)-0.05;
end
for i=1:75
Wet(i)=b1.*((S-Pc(i))./(Pc(i)-R)).^(1/d1);
Dry(i)=b2.*((S-Pc(i))./(Pc(i)-R)).^(1/d2);
end
for i=1:75
W(i)=Wet(i)+(S-Wet(i)).*(Dry(1)-Wet(1))./(S-Wet(i));
end
plot(Pc,W)
%本文方法扫描线计算段%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%设定坐标轴范围和属性%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
set(gca,'XLim',[0.5 4]);
set(gca,'YLim',[0.05 0.3]);
set(gca,'Ytick',[0.05:0.05:0.3]);
xlabel('基质吸力(Kpa)');
ylabel('体积含水量');
title('(b)'); 展开
试一下:
clear;
clc;
%%%%%%%%%%%%%%%%%%%%%
%plot your figure before
%%%%%%%%%%%%%%%%%%%%%
% figure resize
set(gcf,'Position',[100 100 336 264]);
set(gca,'Position',[.165 .17 .80 .74]);
figure_FontSize=9;
set(get(gca,'XLabel'),'FontSize',figure_FontSize,'Vertical','top');
set(get(gca,'YLabel'),'FontSize',figure_FontSize,'Vertical','middle');
set(findobj('FontSize',10),'FontSize',figure_FontSize);
set(findobj(get(gca,'Children'),'LineWidth',0.5),'LineWidth',2);
% 输入参数区%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
S=0.27;% 饱和体积含水量
R=0.081;% 残余体积含水量;%浸润时的残余体积含水量
d1=4.2;
b1=1.75;% 浸润边界的参数
d2=6.1;
b2=2.49;% 干燥边界的参数
G=[3 2.55 2.2 1.7];
C=20;% 韦昌富参数
Pc=ones(1,75);%定义一个有100个元素的矩阵,用来装吸力
W=ones(1,75);% 定义一个有100个元素的矩阵,用来装体积含水量%%%%%本文方法扫描线计算段%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Wet=ones(1,75);
Dry=ones(1,75);
Pc(1)=3;% 定义第一个反弯点的数值
for i=1:75
Pc(i)=Pc(i)-0.05;
end
for i=1:75
Wet(i)=b1.*((S-Pc(i))./(Pc(i)-R)).^(1/d1);
Dry(i)=b2.*((S-Pc(i))./(Pc(i)-R)).^(1/d2);
end
for i=1:75
W(i)=Wet(i)+(S-Wet(i)).*(Dry(1)-Wet(1))./(S-Wet(i));
end
plot(Pc,W)
%本文方法扫描线计算段%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%设定坐标轴范围和属性%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% set(gca,'XLim',[0.5 4]);
% set(gca,'YLim',[0.05 0.3]);
% set(gca,'Ytick',[0.05:0.05:0.3]);
xlabel('基质吸力(Kpa)');
ylabel('体积含水量');
title('(b)');