看板 MATLAB 關於我們 聯絡資訊
請問各位大大 假設我今天3組數字 [1 2 3 ][4 5 6][7 8 9] 每組又分別有3個數字 所以我總共有9個數字 我想讓每個數字都有乘到 1x4x7,1x4x8,1x4x9,1x5x7,1x5x8,1x5x9 1x6x7,1x6x8.......... 類似這樣 那我該怎麼寫我的code 我知道可以用for,可是如果今天數字更多,那我是不是要寫更多的for? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 110.28.16.203 ※ 文章網址: https://www.ptt.cc/bbs/MATLAB/M.1470041491.A.254.html
ejialan: ndgrid 08/01 21:35
at01076172: meshgrid試試看 08/01 22:25
sunev: meshgrid只到二維,三維以上用ndgrid 08/01 23:09
at01076172: 哦對! 08/01 23:58