Wie initialisiert man ein Array von Strukturen in MATLAB?

Wie kann ich preallocate ein array von structs in MATLAB? Ich möchte preallocate "a" in diesem Beispiel, so dass es nicht die Größe mehrmals.

a = []
for i = 1:100
  a(i).x = i;
end

InformationsquelleAutor der Frage Mohammad Moghimi | 2012-12-01

Schreibe einen Kommentar