From 7d4f318b587f69adff192e6fe783a9cdeb390303 Mon Sep 17 00:00:00 2001 From: facat Date: Sun, 14 Apr 2013 22:24:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E4=BA=86=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E6=9B=B2=E7=BA=BF=E7=9A=84=E6=AF=94=E8=BE=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: facat --- plotAndComparison.asv | 6 ++++++ plotAndComparison.m | 12 ++++++++++++ run.m | 3 ++- 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 plotAndComparison.asv create mode 100644 plotAndComparison.m 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 )