28 February 2018 2 8K Report

Dear all;

1: I used SVM to fault detection, now I want to figure out effect of fault in 10 seconds time slot of 60 seconds such that I have a window of data with 10 seconds length like 0-10 seconds,0.005s-10.005 s, 0.01s -10.01s ...60s. and I want to use SVM for each 10 s window of data.

I have some data in excel file which is divided to two parts; upper section is normal data and lower section is fault data and I have 6 features. Entirely I have 24002 data. I wrote a piece of code but I'm not sure if it is correct or not and I want to know how can I correct it? 2:I would like to know how can I divide my data to train and test in for loop for each window?

clc;clear;close all;

T=2001; %length of data in 10s (Window Size)

X=xlsread('Book4');

K=(0.5*length(X))-T+1 % Number of repetitions

window=zeros(2*T,6);

for i=1:K

window=[X(i:i+T-1);X(i+12001:i+12001+T-1,:)];

%% Data Normalaization

m=length(window);

Mean_data=repmat(mean(window),m,1);

Std_data=repmat(std(window),m,1);

data_norm=(window-Mean_data)./(Std_data);

end

I'll appreciate your help.

More Faeze Sdi's questions See All
Similar questions and discussions