There is an error in the Matlab document

1 次查看(过去 30 天)
C=gallery('uniformdata',[5 4], 0);
[Q,R] = qr(C);
[Q,R] = qr(C,0);
[Q,R,P] = qr(C)
Q =
-0.3522 0.8398 -0.4131
-0.7044 -0.5285 -0.4739
-0.6163 0.1241 0.7777
R =
-11.3578 -8.2762
0 7.2460
0 0
P =
0 1
Of course I can not get these Q,R and P, but it certainly in Matlab Offical pdf Documents (MATLAB Primer, P3-31).
  4 个评论
KALYAN ACHARJYA
KALYAN ACHARJYA 2019-5-29
编辑:KALYAN ACHARJYA 2019-5-29
@zhenyu I am getting the same result as mentioned in Matlab document file. Is there any issue?
Q =
-0.6191 -0.1406 0.1899 -0.5058 -0.5522
-0.1506 -0.4084 -0.5034 0.5974 -0.4475
-0.3954 0.5564 -0.6869 -0.1478 0.2008
-0.3167 -0.6676 -0.1351 -0.1729 0.6370
-0.5808 0.2410 0.4695 0.5792 0.2207
R =
-1.5346 -1.0663 -1.2010 -1.4036
0 -0.7245 -0.3474 0.0126
0 0 -0.9320 -0.6596
0 0 0 0.6648
0 0 0 0
Q =
-0.6191 -0.1406 0.1899 -0.5058
-0.1506 -0.4084 -0.5034 0.5974
-0.3954 0.5564 -0.6869 -0.1478
-0.3167 -0.6676 -0.1351 -0.1729
-0.5808 0.2410 0.4695 0.5792
R =
-1.5346 -1.0663 -1.2010 -1.4036
0 -0.7245 -0.3474 0.0126
0 0 -0.9320 -0.6596
0 0 0 0.6648
Q =
-0.2404 0.5849 -0.1207 0.5297 -0.5522
-0.5544 -0.0343 -0.0737 -0.6970 -0.4475
-0.5434 -0.4896 -0.5272 0.3831 0.2008
-0.2431 0.6454 -0.2655 -0.2193 0.6370
-0.5296 -0.0236 0.7947 0.1967 0.2207
R =
-1.6874 -0.8816 -1.3607 -1.2765
0 0.9406 0.3537 0.5433
0 0 -0.6745 0.1277
0 0 0 0.6435
0 0 0 0
P =
0 0 0 1
0 1 0 0
0 0 1 0
1 0 0 0
>>
zhenyu zeng
zhenyu zeng 2019-5-29
编辑:zhenyu zeng 2019-5-30
@KALYAN @KALYAN ACHARJYA
In you link, please click 'QR Factorization' and you can find this:
[Q,R,P] = qr(C)
Q =
-0.3522 0.8398 -0.4131
-0.7044 -0.5285 -0.4739
-0.6163 0.1241 0.7777
R =
-11.3578 -8.2762
0 7.2460
0 0
P =
0 1
1 0
It is weird because we can not get that.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

标签

产品


版本

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by