2011-03-19 127 views
0

我在評論this MATLAB code,它有一些例子,我正在執行test_bnpc_asia.m,但得到一個錯誤,如何糾正它? (我有MATLAB R2010b中)貝葉斯網絡工具箱結構學習包MATLAB

執行:

>> test_bnpc_asia.m 
================== phase I : 
Execution time : 0.12480 

================== phase II : 
Execution time : 0.01560 

================== phase III : 
Thinning - separateA 
Thinning - separateB 
Thinning - orient_edges 
Infering directions 0 boucles 
Execution time : 0.10920 

score_Phase_3 = 

-6.0994e+003 

Report genered in : 

ans = 

C:\Program Files\MATLAB\R2010b\BNT_SLP\examples 

Warning: Direct access of structure fields returned by a function call (e.g., 
call to test_bnpc_asia) is not allowed. See MATLAB 7.10 Release Notes, "Subscripting Into Function Return Values" for details. 
??? Attempt to reference field of non-structure array. 

回答

2

你應該只鍵入

test_bnpc_asia 

代替

test_bnpc_asia.m 

文件擴展名自動添加。如果添加它,MATLAB會認爲函數test_bnpc_asia返回一個結構,並且您想要訪問包含在該結構中的字段「m」。