Coroutines, WaitForSeconds with function Update?

I am having trouble with a coroutine. The bottom script is not my actual script, but a watered down version because the actual script is very long and boring. Basically I have an if/else statement and the else part I want my update to do something, do the function with the coroutine, and then continue back down the line. The problem I face is that Once it gets to the yield WaitForSeconds part is skips the rest of the coroutine and goes back to the Update. Is this because I am making the function mycoroutine yield back to update or what? How can I make a pause in my line of commands. Thank you for the help. I've been trying really hard and looking for already posted coroutine questions but they haven't been much help.

function Update()
{
    if(whatever)
    {
        Do something;
    }
    else
    {
        Debug.Log("Reached else");
        MyCoroutine();
        Debug.Log("Done with else");
    }

}

function MyCoroutine()
{
    Debug.Log("Coroutine started");
    yield WaitForSeconds (5);
    Debug.Log("Coroutine finished");
}

You can't use coroutines like that from Update. You can start coroutines in Update, but you can't yield on them (since using yield can only be done in a coroutine). Update happens once every frame regardless, and will never pause for anything. When scheduling a sequence of events with coroutines, it's much simpler just to avoid using Update entirely, since it's not appropriate for that kind of code.

I just wanted to post a link to CoUpdate, an alternative approach of using Update that support yield instructions. I think this is a common enough problem that has been asked several times so I'll add this link to related questions.

You aren't starting the coroutine properly. You need to use `StartCoroutine("MyCoroutine");`