{"id":387,"date":"2017-09-14T12:05:01","date_gmt":"2017-09-14T15:05:01","guid":{"rendered":"http:\/\/www.professores.uff.br\/diomarcesarlobao\/?page_id=387"},"modified":"2017-09-14T12:05:01","modified_gmt":"2017-09-14T15:05:01","slug":"grams-m","status":"publish","type":"page","link":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/grams-m\/","title":{"rendered":"grams.m."},"content":{"rendered":"<pre>function [Q, R] = grams(A)\r\n\r\n% grams  Gram-Schmidt orthogonalization of the columns of A.\r\n% The columns of A are assumed to be linearly independent.\r\n%\r\n% Q = grams(A) returns an m by n matrix Q whose columns are \r\n% an orthonormal basis for the column space of A.\r\n%\r\n% [Q, R] = grams(A) returns a matrix Q with orthonormal columns\r\n% and an invertible upper triangular matrix R so that A = Q*R.\r\n%\r\n% Warning: For a more stable algorithm, use [Q, R] = qr(A, 0) .\r\n\r\n[m, n] = size(A);\r\nAsave = A;\r\nfor j = 1:n\r\n  for k = 1:j-1\r\n    mult = (A(:, j)'*A(:, k)) \/ (A(:, k)'*A(:, k));\r\n    A(:, j) = A(:, j) - mult*A(:, k);\r\n  end\r\nend\r\nfor j = 1:n\r\n  if norm(A(:, j)) &lt; sqrt(eps)\r\n    error('Columns of A are linearly dependent.')\r\n  end\r\n  Q(:, j) = A(:, j) \/ norm(A(:, j));\r\nend\r\nR = Q'*Asave;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>function [Q, R] = grams(A) % grams Gram-Schmidt orthogonalization of the columns of A. % The columns of A are assumed to be linearly independent. % % Q = grams(A) returns an m by n matrix Q whose columns are % an orthonormal basis for the column space of A. % % [Q, R] = [&hellip;]<\/p>\n","protected":false},"author":22,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[],"tags":[],"class_list":["post-387","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/387","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/comments?post=387"}],"version-history":[{"count":1,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/387\/revisions"}],"predecessor-version":[{"id":388,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/pages\/387\/revisions\/388"}],"wp:attachment":[{"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/media?parent=387"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/categories?post=387"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.professores.uff.br\/diomarcesarlobao\/wp-json\/wp\/v2\/tags?post=387"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}