MATLAB: How can I have all the for loop outputs in one matrix

foe loopquestion

for ii=1:3:numel(b) b(ii) end

Best Answer

ii=1:3 numel(b);
iwant=zeros(length(ii),1) ;
i=0;
for ii=1:3:numel(b)
i=i+1;
iwant(i)= b(ii);
end
Without loop:
iwant=b(1:3;numel(b));