fork download
  1. import numpy as np
  2. c=3
  3.  
  4. #meke A,B,AA,BB
  5. A=np.array( [[ 0.69041153, 0.81024034, 0.40324572], [ 0.84312668, 0.81469053, 0.2784516 ]])
  6. B = A
  7.  
  8. AA = np.array([3.])
  9. BB = AA
  10.  
  11. print B
  12. print BB
  13.  
  14.  
  15.  
  16. #change A,AA
  17. T = np.array([[4.1408769,3.51354199,1.28993112,10.54030441,8.71299119,3.12873028],
  18. [16.93973192,13.91244039,4.96752944,23.33915944,19.1118896,6.8063286 ],
  19. [3.57357285,3.05017967,1.21938886,9.66329856,7.57999436, 3.19145479],
  20. [15.75302426,12.10980906,5.16352073,21.84274997,16.63962376, 7.13558666],
  21. [1.12173823,1.00284567,0.2924078, 3.14706322,2.56936657, 0.8027717 ],
  22. [5.17238821,4.13588748,1.31313561,7.1977132, 5.70240838, 1.82349951]])
  23. X, Y, Z = np.linalg.svd(T)
  24. A[0,0:c]=Y[0:c]/np.sqrt(sum(Y[0:c]**2))
  25.  
  26. AA = np.array([5.])
  27.  
  28.  
  29. #chech B,BB
  30. print B
  31. print BB
  32.  
Runtime error #stdin #stdout 0.08s 10864KB
stdin
Standard input is empty
stdout
Standard output is empty