That is a good idea of solving your problem. There is one thing you're forgetting in your logic: to trim the parts you don't need in the third case. The solution to that is logical indexing, which is a good idea in the first place.
There is some code missing (because I'm not making your homework for you), but these parts should get you where you need to be.
But there is an even better solution: you can put your piecewise function in a single anonymous function and let fplot handle your problems. I'm using different conditions and functions as an example here, but you shouldn't have any trouble adapting it to your own problem.
f=@(t) f1(t).*cond(t) + f2(t).*~cond(t);