is it a homework? should you really use for loop and if-else statements?
I suppose yes. In that case, you need to store your calculated v after every iteraton. For example,
and you may want to store v for every t, so pre-allocate v for the same size now,
now, v is full of zeros. Fill it up inside your loop. It's always wise to use a indexing variable as for-loop counter,
if(t(indx) <= condition)
v(indx) = some equation
get the idea?