construct matrix without for loop in matlab code example
Example: matlab for loop matrix
m=zeros(1,length(t)); %array of zeros
for i=1:length(t) %filling peicewise function
if(t(i)>=0 && t(i)<0.1)
m(i)=10*t(i);
else
m(i)=0;
end
end % for
m=zeros(1,length(t)); %array of zeros
for i=1:length(t) %filling peicewise function
if(t(i)>=0 && t(i)<0.1)
m(i)=10*t(i);
else
m(i)=0;
end
end % for