Advertisement
lalkaed

Koloss

Jul 3rd, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.38 KB | None | 0 0
  1. Z = [1 9 2 3 4 5 2 7 2 5 2 3 9 6 5 4 2 5 7 3 5 6 2 7 6 5 2 5 3 6 2 1 9 2 3 4 5 2 7 2 5 2 3 9 1 9 2 3 4 5 2 7 2 5 2 3 9 1 9 2 3 4 5 2 7 2 5 2 3 9 3]
  2. wmax=7;
  3. Y = Z(Z>wmax);
  4. Z(Z>wmax)=[];
  5. for i=2:length(Z)
  6.   Z(i) = (Z(i)+Z(i-1))/2  
  7. endfor
  8. while length(Z)>8
  9.   A=Z(1:8);
  10.   A = reshape(A,[4,2])
  11.   Z(1:8)=[];
  12. endwhile
  13. q = 8 - length(Z)
  14. Q = zeros(1,q)
  15. F =[Z,Q]
  16. X = reshape(F,[4,2])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement