Hello, I have a case where I don't know how many elements a vector will have and then depending on different size vectors I'll either include something or not include something.
For example, what I have now is just
if numtable2rows >=2 tablerow(2,:) = tablerow(1,:) + [0 50 0 0]; end if numtable2rows >=3 tablerow(3,:) = tablerow(2,:) + [0 50 0 0]; end if numtable2rows >=4 tablerow(4,:) = tablerow(3,:) + [0 50 0 0]; end if numtable2rows >=5 tablerow(5,:) = tablerow(4,:) + [0 50 0 0]; end
and I'm just expecting no more than 5 elements in numtable2row.
Does anyone know a more efficient way to do this?
Thank you in advance!
Best Answer