-2

I use MATLAB R2012b, and for some reason occasionally when I put "bad stuff" in the command line, it executes, but then the --> arrow thing besides the $$f_x$$ symbol disappears and I can't do anything in the command line.

For instance if I write an if statement with nothing else, it erases that arrow thing.

Lemon
  • 79
  • 1
  • 9

2 Answers2

4

That's because you're starting a loop. It's waiting for you to type the code to go within the loop, and it is terminated when you type end to end the loop. For example:

if(x==0)
  y = y + 1;
end
LeonardBlunderbuss
  • 1,264
  • 1
  • 11
  • 22
1

When you see this it typically means that you did not finish a command yet. This most commonly occurs with statements like for or if.

Example:

if 1

Now you are inside the if statement, and not simply at the basic prompt. Therefore you will not see anything happen. This can be tested by continuing with:

1+1 %Normally outputs 2

Obviously nothing happens. You now have two choices. Either you realize that the if was there by mistake, and you cancel with CTRL+C. In this case you will not see any output. Of course you can also choose to finish the statement:

end
Dennis Jaheruddin
  • 21,208
  • 8
  • 66
  • 122
  • Obviously not happening, but perhaps interesting for other readers is that it can also happen when you provide invalid input characters, like `mean(␇)` as described in [What happens when I call the ␇ character](http://stackoverflow.com/questions/21097072/what-happens-when-i-call-the-character-in-matlab) – Dennis Jaheruddin Feb 17 '14 at 13:51