You can use a conditional statement in Matlab to check if t is between 0 and y. Here's the code:
main.m99 chars6 lines
The &&
operator combines two conditions. In this case, it checks if both t >= 0
and t <= y
are true. If they are, the first message is displayed. If not, the second message is displayed.
gistlibby LogSnag