加入了各种统计值。

This commit is contained in:
facat
2013-01-21 21:47:54 +08:00
parent 7ded138066
commit 0f8edee30b
15 changed files with 266 additions and 128 deletions

14
@ForThesis/AddPDQDPGQG.m Normal file
View File

@@ -0,0 +1,14 @@
function this=AddPDQDPGQG( this, PD,QD,PG,QG)
%ADDPD Summary of this function goes here
% Detailed explanation goes here
if this.currentPos>this.sampleNum
error('');
return;
end
this.currentPos=this.currentPos+1;
this.PDArray(:,this.currentPos)=PD;
this.QDArray(:,this.currentPos)=QD;
this.PGArray(this.currentPos)=PG;
this.QGArray(this.currentPos)=QG;
end

30
@ForThesis/ForThesis.m Normal file
View File

@@ -0,0 +1,30 @@
classdef ForThesis
%UNTITLED Summary of this class goes here
% Detailed explanation goes here
properties
currentPos=0;
sampleNum=0;
LoadNum=0;
PDArray=0;
QDArray=0;
PGArray=0;
QGArray=0;
end
methods
function this=ForThesis(sampleNum,LoadNum)
this.currentPos=0;%100
this.sampleNum=sampleNum;
this.LoadNum=LoadNum;
this.PDArray=zeros(LoadNum,sampleNum);
this.QDArray=zeros(LoadNum,sampleNum);
this.PGArray=zeros(sampleNum,1);
this.QGArray=zeros(sampleNum,1);
end
end
end

View File

@@ -0,0 +1,7 @@
function MaxDeviation(this,PG0,QG0,PD0,QD0)
PD0Array=repmat(PD0,1,this.sampleNum);
QD0Array=repmat(QD0,1,this.sampleNum);
PDMaxDev=max(abs(this.PDArray-PD0Array),[],2)
QDMaxDev=max(abs(this.QDArray-QD0Array),[],2)
PG0Array=repmat()
end

11
@ForThesis/MaxDeviation.m Normal file
View File

@@ -0,0 +1,11 @@
function [output_arg]=MaxDeviation(this,PG0,QG0,PD0,QD0)
PD0Array=repmat(PD0,1,this.sampleNum);
QD0Array=repmat(QD0,1,this.sampleNum);
PDMaxDev=max(abs( (this.PDArray-PD0Array)./PD0Array ),[],2);
QDMaxDev=max(abs( (this.QDArray-QD0Array)./QD0Array ),[],2);
PG0Array=repmat(PG0,this.sampleNum,1);
QG0Array=repmat(QG0,this.sampleNum,1);
PGMaxDev=max(abs( (PG0Array-this.PGArray)./PG0Array ));
QGMaxDev=max( abs( (QG0Array-this.QGArray)./QG0Array ) );
output_arg=max([PDMaxDev;QDMaxDev;PGMaxDev;QGMaxDev]);
end

7
@ForThesis/MeanPD.m Normal file
View File

@@ -0,0 +1,7 @@
function [ output_args ] = MeanPD(this)
%MEANPD Summary of this function goes here
% Detailed explanation goes here
output_args=sum(this.PDArray,2)/this.sampleNum;
end

7
@ForThesis/MeanPG.m Normal file
View File

@@ -0,0 +1,7 @@
function [ output_args ] = MeanPG( this )
%MEANPG Summary of this function goes here
% Detailed explanation goes here
output_args=sum(this.PGArray,1)/this.sampleNum;
end

7
@ForThesis/MeanQD.m Normal file
View File

@@ -0,0 +1,7 @@
function [ output_args ] = MeanQD(this)
%MEANQD Summary of this function goes here
% Detailed explanation goes here
output_args=sum(this.QDArray,2)/this.sampleNum;
end

7
@ForThesis/MeanQG.m Normal file
View File

@@ -0,0 +1,7 @@
function [ output_args ] = MeanQG( this )
%MEAQG Summary of this function goes here
% Detailed explanation goes here
output_args=sum(this.QGArray,1)/this.sampleNum;
end

View File

@@ -0,0 +1,15 @@
function [ output_args ] = StatDeviation( this,PG0,QG0,PD0,QD0 )%ͳ¼ÆÎó²î
%STATDEVIATION Summary of this function goes here
% Detailed explanation goes here
PD0Array=repmat(PD0,1,this.sampleNum);
QD0Array=repmat(QD0,1,this.sampleNum);
PDMaxDev=max(abs(this.PDArray-PD0Array),[],2);
QDMaxDev=max(abs(this.QDArray-QD0Array),[],2);
PG0Array=repmat(PG0,this.sampleNum,1);
QG0Array=repmat(QG0,this.sampleNum,1);
PGMaxDev=max(abs(PG0Array));
QGMaxDev=max(abs(QG0Array));
end

View File

@@ -0,0 +1,20 @@
function [ output_args ] = StatDeviation( this,PG0,QG0,PD0,QD0 )%ͳ¼ÆÎó²î
%STATDEVIATION Summary of this function goes here
% Detailed explanation goes here
PD0Array=repmat(PD0,1,this.sampleNum);
QD0Array=repmat(QD0,1,this.sampleNum);
PDDev=(this.PDArray-PD0Array)/0.05;
QDDev=(this.QDArray-QD0Array)/0.05;
PG0Array=repmat(PG0,this.sampleNum,1);
QG0Array=repmat(QG0,this.sampleNum,1);
PGDev=(PG0Array-this.PGArray)/0.01;
QGDev=(QG0Array-this.QGArray)/0.01;
wholeMat=[PDDev;QDDev;PGDev';QGDev'];
t1=wholeMat.^2;
t2=sum(t1,1);
t3=t2/size(t1,1);
t4=t3.^2;
output_args=sum(t4)/length(t4);
end