1
例如我有創建矩陣2x2的函數:[1 2; 3 4] 我有這樣簡單的功能:無法在Simulink的Matlab函數中輸出多維矩陣
function[result] = Rho(x)
// I've tried and so:
result = [1 2; 3 4];
// And so:
result(1,1) = 1;
result(1,2) = 2;
result(2,1) = 3;
result(2,2) = 4;
在Matlab中窗口我看到正確的結果:
>> Rho(1)
ans =
1 2
3 4
但在Simulink我總是得到[1; 2; 3; 4]。我的錯誤在哪裏?
P.S.我忘了刪除函數的參數x,因爲在實際函數中,我根據參數x製作矩陣。但它在我們的例子中不起作用
非常感謝。它有幫助。我應該在塊屬性中注意到這個選項)) – 2011-04-07 21:22:46