I need to create a bunch of fields in a struct with names that differ only by a digit, like this:
S(1).field1 = [];
S(1).field2 = [];
S(1).field3 = [];
S(1).field4 = [];
S(1).field5 = [];
This is a short version of the list. The real one is actually long and doesn't look pretty in the script so I am wondering whether I can initiate those empty fields within a for loop. I tried:
for i = 1:5
S(1).field{i} = [];
end
but it doesn't work.