MATLAB: Error: Unable to perform assignment because brace indexing is not supported for variables of this type

errorfor loopMATLAB

Hi everybody,
if I launch this code using a single POINT it works, if instead I insert it inside a loop (with POINT that change at every iteration) this message error appears to me:
Unable to perform assignment because brace indexing is not supported for variables of this type
POINT=[x,y,z]
nRow = size(A, 1);
for iRow = 1:nRow
STRAIGHT=-20:.01:20;
STRGT{iRow}=repmat(POINT,length(STRAIGHT),1)'+((A(iRow,:))-POINT)'*STRAIGHT;
end
How can i resolve it?
Thank's!

Best Answer

STRGT=cell(1,nRow); % before the loop ,also move STRAIGHT outside the loop