Info

この質問は閉じられています。 編集または回答するには再度開いてください。

problem with matlab when trying to use a condition

1 回表示 (過去 30 日間)
mar vouz
mar vouz 2016 年 4 月 26 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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 ?

回答 (1 件)

jgg
jgg 2016 年 4 月 26 日
You've opened a scoped environment. In order to end the scope, you need to use end:
if i == 1
% do stuff
end
If you don't use the end command, it will just continue to read in commands into the environment until you terminate it.
  1 件のコメント
jgg
jgg 2016 年 4 月 26 日
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.

この質問は閉じられています。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by