How do I clear the screen after typing a part of for loop ?

1 view (last 30 days)
>> for i = -100:100
for j = -100:100
r = [i j 40]
end
clear
clc
clclclclc
clc
exit
exit()
clc
Above is the code , I typed and I want to return back to clear screen. clc does not work here. How do I get back to a blank screen without closing the application and using some command which terminates what I have typed till now?

Accepted Answer

Guillaume
Guillaume on 28 Jan 2019
Once you've started with a for (or while) statement at the command prompt, matlab waits for you to enter the corresponding end statement before evaluating everything that you've typed. You can see that you are in this mode because there's no >> prompt when you enter statements.
If at any point you decide you no longer want to execute these statements, then press CTRL + C to return back to the >> command prompt.

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!