Kann nicht die Ausgabe von mehrdimensionalen matrix im Matlab-Funktion in Simulink

Ich habe zum Beispiel Funktion, die erstellt 2x2 matrix : [1 2; 3 4]
Ich habe eine solche einfache Funktion:

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;

Im Matlab-Fenster sehe ich rechts Ergebnis:

>> Rho(1)
ans =
     1     2
     3     4

Aber in Simulink bekomme ich immer [1;2;3;4]. Wo ist mein Fehler?

Kann nicht die Ausgabe von mehrdimensionalen matrix im Matlab-Funktion in Simulink

P. S. ich vergaß zu entfernen argument x der Funktion, denn in real-Funktion, die ich machen, die matrix, abhängig vom argument x. Aber es spielt nicht die Rolle in unserem Beispiel

InformationsquelleAutor Larry Cinnabar | 2011-04-07

Schreibe einen Kommentar