看板 MATLAB 關於我們 聯絡資訊
zhewei:\ 08/08 21:28
zhewei:\是matlab幫你弄好的,不用\ 也可以參考我po的網址來求解 08/08 21:50
Append:doc mldivide裡面有寫吧@___@"" 08/08 23:06
YoursEver:預設是用QR分解來解,若考慮到condition number之類的問 08/09 00:36
YoursEver:題,可以查查Householder/Givens該怎麼寫. (Matlab) 08/09 00:37
waveken:如果他要求LSM 怎可能是用反矩陣就求解出來 08/09 23:24
waveken:除非他問錯問題 ! 或是他寫的方式讓大家誤解! 08/09 23:24
雖然確實不能算是反矩陣...不過就是這樣喔。=P 首先是解法。"/" (也就是mldivide) mldivide at MATLAB Documentation http://www.mathworks.com/access/helpdesk/help/techdoc/ref/mldivide.html Least Squares Solutions If the equation Ax = b does not have a solution (and A is not a square matrix), x = A\b returns a least squares solution — in other words, a solution that minimizes the length of the vector Ax - b, which is equal to norm(A*x - b). See Example 3 for an example of this. . . . If A is not square, then Householder reflections are used to compute an orthogonal-triangular factorization. A*P = Q*R where P is a permutation, Q is orthogonal and R is upper triangular (see qr). The least squares solution X is computed with X = P*(R\(Q'*B)) Least Squares Solutions at Wolfram Mathworld http://ppt.cc/sJAV A general way to find a least squares solution to an overdetermined system is to use a singular value decomposition to form a matrix that is known as the pseudo-inverse of a matrix. In Mathematica this is computed with PseudoInverse. This technique works even if the input matrix is rank deficient. The basis of the technique is given below. 好這樣應該夠了。 有興趣的話, Moore-Penrose Matrix Inverse at Wolfram Mathworld http://ppt.cc/PhR~ 順便說,MATLAB Documentation建議, 解這個問題的時候盡量不要生出inverse(喔當然這裡是pseudo-inverse), 而是直接用"\"。 A frequent misuse of inv arises when solving the system of linear equations. One way to solve this is with x = inv(A)*b. A better way, from both an execution time and numerical accuracy standpoint, is to use the matrix division operator x = A\b. ---- 另外,如果是我們真的誤解了的話,請放心的說出來。... 以上。=) -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 219.71.211.169
waveken:我是猜的問題沒有那麼單純 08/10 15:07
waveken:應該是constrained linear least-squares problems 08/10 15:08
waveken:function lsqlin 之類的 08/10 15:08
waveken:某些值需要疊代 不然他直接說解反矩陣就好啦 ! 08/10 15:09
waveken:所以我才說 可能他講錯 或講不夠詳細 ! 08/10 15:11
waveken:不然就是他們老師故做玄虛拉 ! 08/10 15:13
Append:...為什麼是他們老師? 我猜不出來這跟他們老師的關係... 08/10 15:15
Append:另外 一個星期以來我第一次看到你推文裡面有指引... 08/10 15:17
waveken:AX=B A,B是常數矩陣;僅X未知 那應該是我想太複雜了! 08/10 15:19
waveken:Append 問太簡單的 我還是沒回答吧 ! 08/10 15:19
waveken:有的我做過or我會then我就指引拉! 08/10 15:20