Assign Array values to object Array in Matlab
<p>I have the following problem:</p>

<pre><code>[obj(:).Radius] = arrayOfRadius;
</code></pre>

<p>I have an Array with radius for every single object. The upper code doesn't work though the object has the same size as the right hand arrayOfRadius.</p>

<p>I could solve this with a for loop, sure:</p>

<pre><code>for i = 1:length(obj)
   obj(i).Radius = arrayOfRadius(i);
end
</code></pre>

<p>That's not the way I'd like to solve it. I already found the "deal" function. But the deal function copies the whole arrayOfRadius() in every object.</p>

<p>Can someone help me out? </p>

<p>Thank you very much.</p>