How to determine value of t when plotting a signal
As @Dave Tweed mentioned, the time component of your function is fine. The crux of your problem is that you've asked Matlab to plot y vs t in a 2D plot when you've given three variables real(y), imag(y), t. It can't do that so it's truncated the imaginary part of y and given you the warning to let you know. You've got a lot of options for how to display them both. I like 3D plots, but two lines will usually do the trick. 

Something like the following rough code:

figure
plot(t, real(y))
hold on
plot(t, imag(y))
hold off


Will produce something like this:



A quick sanity check: at t = 0, we've got y = 2*exp(0) = 2 + j0. Looks good. Add your title, x-axis label, y-axis label, and legend and you're good to go.



If you're bound to a 2D plot with one axis being time then the above is an option. However, as @user24368 mentioned you could also plot magnitude and angle. If you don't need to plot against time you can also plot the real vs the imaginary components of the signal.

It's up to you to determine the best way to convey the data to the target audience; whether that's a professor or a work presentation.