MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   外部控制參數個數 (https://www.labfans.com/bbs/showthread.php?t=3348)

fgabertb 2008-05-30 13:24

外部控制參數個數
 
我的程式中

其中有一串 假設得到 n=3

則下一步執行

[ a1 a2 a3 ] = ndgrid(1:3 , 4:6 , 7:9 )

然後接下去運算

同理

n=4

[ a1 a2 a3 a4] = ndgrid(1:3 , 4:6 , 7:9 , 10:12 )

有沒有辦法從外部去控制 參數的行為呢??:cool:

fanxing39 2008-05-30 20:38

[ a1 a2 a3 ] = ndgrid(1:3 , 4:6 , 7:9 ) 中的 ndgrid是个什么矩阵,几行几列的?:smile:

fgabertb 2008-05-30 20:59

[QUOTE=fanxing39;11654][ a1 a2 a3 ] = ndgrid(1:3 , 4:6 , 7:9 ) 中的 ndgrid是个什么矩阵,几行几列的?:smile:[/QUOTE]


ndgrid 是一個類似 meshgrid 的內建函數

我想問由外部控制 參數個數 的方法:smile:


所有时间均为北京时间。现在的时间是 03:18

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.