MATLAB: Populate structure array efficiently

indexingstructure

Hi,
I am wondering if this question is too simple and if I am missing something important. How do I efficiently populate a structure array such that
A = 6:10;
and the resulting structure array is
S(1).A = 6;
S(2).A = 7;
...
S(5).A = 10;
Using a loop S is fairly easy to obtain, but there are probably much more efficient ways to do so.
Regards, Anon

Best Answer

S = struct('A',num2cell(A))