Skip to content

Instantly share code, notes, and snippets.

@stephentu
Last active February 13, 2016 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephentu/eec59724ebc1650378a5 to your computer and use it in GitHub Desktop.
Save stephentu/eec59724ebc1650378a5 to your computer and use it in GitHub Desktop.
>> (A*P)'*(A*P)
ans =
1.8889 1.1881 1.4033 1.9244 1.5923 1.8274
1.1881 1.2118 1.5635 1.8397 1.3853 1.1210
1.4033 1.5635 2.2357 2.4439 1.8408 1.3483
1.9244 1.8397 2.4439 3.5828 2.0221 2.1862
1.5923 1.3853 1.8408 2.0221 2.0355 1.4963
1.8274 1.1210 1.3483 2.1862 1.4963 1.9846
>> H11 = ((A*P)'*(A*P))(1:2, 1:2)
H11 =
1.8889 1.1881
1.1881 1.2118
>> H22 = ((A*P)'*(A*P))(3:4, 3:4)
H22 =
2.2357 2.4439
2.4439 3.5828
>> H33 = ((A*P)'*(A*P))(5:6, 5:6)
H33 =
2.0355 1.4963
1.4963 1.9846
>> H = [H11, zeros(2, 2), zeros(2, 2);
zeros(2, 2), H22, zeros(2, 2);
zeros(2, 2), zeros(2, 2), H33]
H =
1.88889 1.18811 0.00000 0.00000 0.00000 0.00000
1.18811 1.21176 0.00000 0.00000 0.00000 0.00000
0.00000 0.00000 2.23567 2.44387 0.00000 0.00000
0.00000 0.00000 2.44387 3.58275 0.00000 0.00000
0.00000 0.00000 0.00000 0.00000 2.03555 1.49628
0.00000 0.00000 0.00000 0.00000 1.49628 1.98456
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment