diff --git a/plotAndComparison.asv b/plotAndComparison.asv new file mode 100644 index 0000000..7990bee --- /dev/null +++ b/plotAndComparison.asv @@ -0,0 +1,6 @@ +function [ output_args ] = plotAndComparison( rVolt,rVAngel,SEVolt,SEVAngel ) +x=1:length(rVolt); +plot(x,rVolt) + +end + diff --git a/plotAndComparison.m b/plotAndComparison.m new file mode 100644 index 0000000..7eda615 --- /dev/null +++ b/plotAndComparison.m @@ -0,0 +1,12 @@ +function plotAndComparison( rVolt,rVAngel,SEVolt,SEVAngel ) +x=1:length(rVolt); +subplot(2,1,1); +plot(x,rVolt,'r-'); +hold on +plot(x,SEVolt); +subplot(2,1,2); +plot(x,rVAngel,'r-'); +hold on +plot(x,SEVAngel); +end + diff --git a/run.m b/run.m index 97499c8..7647912 100644 --- a/run.m +++ b/run.m @@ -10,7 +10,7 @@ addpath('.\Powerflow') % 电压 相角 %% %% 开始生成量测量 -sigma=0.05;% 标准差 +sigma=0.01;% 标准差 %% 电压 %电压幅值 rVolt=Volt; %幅值 @@ -117,3 +117,4 @@ fprintf('目 fprintf('相对误差\n'); (abs(rVolt-double(SEVolt)))./(rVolt) MaxDeviation(rVolt,SEVolt,rVAngel,SEVAngel) +plotAndComparison( rVolt,rVAngel,SEVolt,SEVAngel )