MATLAB Answers

problem with matlab when trying to use a condition

2 views (last 30 days)
mar vouz
mar vouz on 26 Apr 2016
Commented: jgg on 26 Apr 2016
Hello,I have a problem with Matlab, if I type a condition such as : if i=1:50 then or while i<= 50 matlab allows me to write other commands but nothing happens at the workspace.Even if I type clc in orer to delete everything ,matlab still remains the same.Any ideas ?


Sign in to comment.

Answers (1)

jgg on 26 Apr 2016
You've opened a scoped environment. In order to end the scope, you need to use end:
if i == 1
% do stuff
If you don't use the end command, it will just continue to read in commands into the environment until you terminate it.

  1 Comment

jgg on 26 Apr 2016
This is not related to the question you've posted here. If this answer resolved your problem, accept it, then post this question as a new question instead.

Sign in to comment.