You can use sum() instead of manually adding x1 to x5.
y=zeros(length(t),5);
for j=1:length(t)
y_m(j,:)=sum(x);
end
However i don't think that your calculation of x(j) is going to work that way.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!