MATLAB: Question about how to avoid using eval

eval

Hello, all.
I got to know that using "eval" is not efficient and may cause several problems. I have used "eval" a lot in my previous codes.
If I want to replace the following expression without using "eval", would anyone help me one this? Thank you very much.
for jjjj=1:5
for iiii=1:40
for kkkk=1:3
x1(kkkk,:) = (1:10)*kkkk;
eval(['Resp.Phi',num2str(jjjj),'.Mu',num2str(iiii),'.Respx1(kkkk,:) = x1(kkkk,:);']);
end
end
end

Best Answer

Resp.(sprintf('Phi%d',jjjj).(sprintf('Mu%d',iiii)),.Respx1(kkkk,:) = x1(kkkk,:);