1 / 19

背景設定

背景設定. %% The matlab homework by FL TAI , M93860011 %% Neural Network Toolbox. Version 4.0.2 (R13SP1) 27-Dec-2002 %% the command: help nnet %% newlind for cosine function time = 0:0.025:5; %time start 0 to 5 sec, step:0.025 T=cos(time*4*pi); % the regular is 2 pi

mercury
Download Presentation

背景設定

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 背景設定 • %% The matlab homework by FL TAI , M93860011 • %% Neural Network Toolbox. Version 4.0.2 (R13SP1) 27-Dec-2002 • %% the command: help nnet • %% newlind for cosine function • time = 0:0.025:5; %time start 0 to 5 sec, step:0.025 • T=cos(time*4*pi); % the regular is 2 pi • Q=length(T); % calculate the number of T

  2. 迴圈 • P=zeros(5,Q); %set P = Zeros array , 5 - Q matrix, all element is zero • %% rewrite the P matrix, P is the netline input • for n=1:10 ; % recurrence circle from 1 to 10 • P(n,(n+1):Q)=T(1,1:(Q-n)); • % set P , row 1 :2-Q element = T row1 1:Q-1element • end; % end the recurrence

  3. 類神經處理 • net=newlind(P,T); • % Linear layers are often used as adaptive filters • % for signal processing and prediction. • a=sim(net,P); % calculate the net output by P

  4. 畫圖 • figure (1); • plot(time,a,time,T,'*'),ylabel('Amplitude (gal)'),xlabel('Time (s)'),grid on,title('Neural Network --cosine,input=10'); • % compare the sim and raw data

  5. 運算 • [xa,ia]=max(abs(a(1,1:201))); %find the first abs maximum error position of matrix a, must be 1 • ma=(ia-1)*0.025; % ma is the first time arrive the maximum error • disp(xa); %first maximum error value • disp(ma); %ma= the time of first maximum error value • text(3,1.2,'max net-sim y :1.0192gal'); %1.0192 = disp(xa) • text(3,1.4,'max net-sim x: 0.025sec'); %0.025 = disp(ma)

  6. 畫圖 • figure (2); • e=T-a; • plot(time,e),ylabel('error (gal)'),xlabel('Time (s)'),grid on,title('Neural Network --cosine,input=10' ); %plot the error signal • % plot the error line

  7. 計算誤差 • [xe,ie]=min(abs(e(1,1:201))); %find the first abs minimum error position of matrix e, • %% x =abs minimum value, must be 0, i = the column position • me=(ie-1)*0.025; % me is the first time arrive the minimum error • disp(xe); %first minimum error value, disp on monitor • disp(me); %me= the time of first minimum error value • text(3,0.9,'min error y : 0.00011083 gal'); %0.00011083 = disp(xe) • text(3,1.1,'min error x: 2.525sec'); %2.525 = disp(me)

  8. 背景設定 • %% The matlab homework by FL TAI , M93860011 • %% Neural Network Toolbox. Version 4.0.2 (R13SP1) 27-Dec-2002%% the command: help nnet%% newlind for seismogram time = 25:0.05:45; %0.005 tran 0.05 • load ch080t2545.txt % the 921 earthquake data of chy080, only the U(+) sequence% the raw data is select from 25 sec to 45 sec ,T=ch080(5000:9000,1)';% and devide 10 ,c=T(1:10:4001)'; form 1 to 4001 step 10 • T=ch080t2545(:,1)'; % set T is a row array • Q=length(T);

  9. 迴圈 • P=zeros(10,Q); • for n=1:10 ; % recurrence circle from 1 to 5P(n,(n+1):Q)=T(1,1:(Q-n)); % set P , row 1 :2-Q element = T row1 1:Q-1element end; % end the recurrence

  10. 類神經處理 • net=newlind(P,T);% Linear layers are often used as adaptive filters% for signal processing and prediction.a=sim(net,P); % calculate the net output by P

  11. 畫圖 • figure (1);plot(time,a,time,T,'*'),ylabel('Amplitude (gal)'),xlabel('Time (s)'),grid on,title('Neural Network --921 shy080 U(+) , input=10'); • figure (2);e=T-a;plot(time,e),ylabel('error (gal)'),xlabel('Time (s)'),grid on,title('Neural Network --921 shy080 U(+) , input=10');

  12. 計算誤差 • me=mean(abs(e(1,1:401))); %find the first abs mean error position of matrix e, disp(me); %me= the time of first mean error valuetext(40,210,'mean error y: 28.8327 gal'); • %2.525 = disp(me)

  13. time = 1:1:1460; load pressure.txt T=pressure(:,1)'; Q=length(T); P=zeros(1460,Q); for n=1:1460 ; P(n,(n+1):Q)=T(1,1:(Q-n)); end; net=newlind(P,T); a=sim(net,P); figure (1); plot(time,a,time,T,'*'),ylabel('pressure (mb)'),xlabel('Time (day)'),grid on,title('pressure , input=1460 days'); figure (2); e=T-a; plot(time,e),ylabel('error (mb)'),xlabel('Time (day)'),grid on,title('pressure , input=1460 days'); 範例:92-95年最高氣壓資料處理

More Related