在Matlab中當一個人試圖訪問不存在通常引發錯誤的矩陣的元素: >> month(0)
??? Subscript indices must either be real positive integers or logicals.
我想知道是否存在允許在這樣的情況下供給的默認值的函數。例如: >> get_def(month(0), NaN)
ans =
NaN
P.S.
Visual Basic具有在評估表達式時有時隱式調用的默認屬性。但是,我似乎遇到了這種隱式執行默認屬性的差異。該項目的佈局是這樣的: 的Class1: property test -> class2 (default)
等級2: property test -> string "hello world" (default)
Form1中: Dim x As New Class2
Msg