Re: [問題] 重複排列已回收
※ 引述《ericabab (ㄍㄠˊ)》之銘言:
: 版上之前有人問過,但都沒有解答
這應該有很多人回答過了
: 請問有人知道怎麼寫比較快嗎
: 用迴圈慢慢跑好蠢....
: ex: 假設有 1 2 3 4,想跑出
: [1 1 1 1]
: [1 1 1 2]
: [1 1 1 3]
: .
: .
: .
: [4 4 4 4]
: 共4^4=256情況
: 謝謝
[ A4 A3 A2 A1 ] = ndgrid( [ 1 : 4 ] , [ 1 : 4 ] , [ 1 : 4 ] , [ 1 : 4 ] ) ;
A = [ A1( : ) A2( : ) A3( : ) A4( : ) ]
general型以前也有貼過
不過想不起來再哪篇了
--
Deserves death! I daresay he does. Many that live deserve death. And some die
that deserve life. Can you give that to them? Then be not too eager to deal out
death in the name of justice, fearing for your own safty. Even the wise cannot
see all ends.
Gandalf to Frodo
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.131.229.210
推
11/25 07:28, , 1F
11/25 07:28, 1F
→
11/25 17:36, , 2F
11/25 17:36, 2F
推
02/08 12:44, , 3F
02/08 12:44, 3F
→
02/08 12:45, , 4F
02/08 12:45, 4F
討論串 (同標題文章)
MATLAB 近期熱門文章
PTT數位生活區 即時熱門文章