MATLAB: Structure

structures

Hello, I have a structure that has got 20 values :
temp_q(j)=struct('ff' ,{temp_Q});
I have something like this
>> temp_q(1,1).ff{1,1}
ans =
0.0046 0.2417
>> temp_q(1,1).ff{2,1}
ans =
0.0844 0.9421
>> temp_q(1,1).ff{3,1}
ans =
0.2599 0.5752
>> temp_q(1,1).ff{4,1}
ans =
0.1818 0.8212
>> temp_q(1,1).ff{5,1}
ans =
0.1450 0.4509
>> temp_q(2,1).ff{1,1}
ans =
0.5499 0.6477
>> temp_q(2,1).ff{2,1}
ans =
0.3998 0.9561
>> temp_q(2,1).ff{3,1}
ans =
0.8693 0.6491
But i want to make it like this label it as
>> temp_q.Q1
ans =
0.0046 0.2417
0.0844 0.9421
0.2599 0.5752
0.1818 0.8212
0.1450 0.4509
>> temp_q.Q2
ans =
0.5499 0.6477
0.3998 0.9561
0.8693 0.6491
Thanks in advance

Best Answer

You mean like this?
temp_Q=1:20;
temp_q=struct('ff',mat2cell(temp_Q,1,repmat(1,20,1)))