看板 [ MATLAB ]
討論串[問題] 有關於triu跟tril
共 2 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓1(1推 0噓 1→)留言2則,0人參與, 最新作者LiamIssac (Madchester)時間14年前 (2011/04/10 11:41), 編輯資訊
0
0
0
內容預覽:
自問自答XD. n = floor(sqrt(2*length(V)))+1;. M = zeros(n);. M(logical(triu(ones(n),1))) = V;. V is the array of size 1-by-(0.5*n*(n-1)). --. Kraft Durch F

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者LiamIssac (Madchester)時間14年前 (2011/04/10 09:25), 編輯資訊
0
0
0
內容預覽:
triu是把矩陣的upper triangular部分取出 其他為零. triu(ones(3),1) = [0 1 1;0 0 1;0 0 0]. (tril的使用方式是一樣的). 那如果我今天已經有upper triangular的部分. 存成一個array -> [1,1,1] 微度剛好是1*
首頁
上一頁
1
下一頁
尾頁