看板 Mathematica 關於我們 聯絡資訊
※ 引述《iohan (iohan)》之銘言: : 不是行列交換 : 例如 : | a 0 A | : | 0 b B | : | X Y c | : 如果我要交換2,3基底 : 則變成 : | a A 0 | : | X c Y | : | 0 B b | : 現在手上有一個元素數值已知,但內容計算相當複雜的矩陣 : 手動重新KEY IN 似乎很花時間 : 請問MATHEMATICA有沒有對現成的矩陣進行基底次序調換的語法? : 感謝各位先進 其實這是第 2,3 列交換再第 2,3 行交換 |1 0 0| 那麼就左右各 Dot 上 |0 0 1| 即可 |0 1 0| 或者如果覺得 key 排列矩陣有點煩的話也可以用 Permute Permute[#, {1,3,2}]& /@ Permute[matrix, {1,3,2}] 或更懶(?)的 Permute[#, Cycles[{{2,3}}]]& /@ Permute[matrix, Cycles[{{2,3}}]] -- 'Oh, Harry, don't you see?' Hermione breathed. 'If she could have done one thing to make absolutely sure that every single person in this school will read your interview, it was banning it!' ---'Harry Potter and the order of the phoenix', P513 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 123.195.39.85 ※ 文章網址: http://www.ptt.cc/bbs/Mathematica/M.1396271503.A.A4E.html ※ 編輯: LPH66 (123.195.39.85), 03/31/2014 21:13:03
sunev:#[[{1, 3, 2}, {1, 3, 2}]]&[your_matrix] 03/31 21:39
iohan:多謝解答 04/02 14:17