root/applications/dual/SIDP/SIDPS/matlab/update.m
    @
      1274
    
  
      | Revision 1181, 381 bytes (checked in by zimamiro, 15 years ago) | 
|---|
| Line | |
|---|---|
| 1 | function [H_new C_new ]=update(H_old, C_old,index) | 
| 2 | H_new=zeros(size(H_old)+[0 1]); | 
| 3 | C_new=zeros(size(C_old)+[0 1]); | 
| 4 | for i=1:index | 
| 5 | H_new(i)=H_old(i); | 
| 6 | C_new(i)=C_old(i); | 
| 7 | end | 
| 8 | |
| 9 | for i=index+1:size(H_old,2) | 
| 10 | H_new(i+1)=H_old(i); | 
| 11 | C_new(i+1)=C_old(i); | 
| 12 | end | 
| 13 | |
| 14 | H_new(index+1)=(H_old(index)+H_old(index+1))/2; | 
| 15 | C_new(index+1)=(C_old(index)+C_old(index+1))/2; | 
| 16 | |
| 17 | end | 
        Note: See TracBrowser
        for help on using the browser.
      
      
