MATLAB: How to initialise field name of struct array

arraycelldatafieldstruct

I want to set some fields of a struct array, like .name .age .id then I want to put data in one line. Is it possible to do something like this?
% initialise data struct with fields .name, .age, .id in this order, than put data like this:
data(1) = ... ('John',12,'ABC123') ... ;
The result what I want is this:
data(1).name = 'John';
data(1).age = 12;
data(1).id= 'ABC123';

Best Answer

How is this question different from your previous one on the same subject?
data = cell2struct({'John', 12, 'ABC123'}, {'name', 'age', 'id'}, 2)