How to inhibit clear and clc at the beginning of an m-file?
6 views (last 30 days)
Show older comments
Bradley Champagne
on 24 Jan 2016
Commented: Bradley Champagne
on 24 Jan 2016
I am required to have the commands clear; clc; at the beginning of my homework problem programs. Normally I known that the semicolons should inhibit these commands; however, they end up clearing the screen anyway and I am unable to perform my homework. How do I properly inhibit the clear; clc; commands from preventing me from doing my homework?
0 Comments
Accepted Answer
Image Analyst
on 24 Jan 2016
Semicolons prevent/suppress expressions from echoing their value to the command window. They do not prevent the expression from being evaluated or the line of code from being executed. To do that you need to comment out the line by putting a % symbol at the beginning of the line.
Either calling, or not calling, the clc and clear commands will not prevent you from doing your homework.
More Answers (0)
See Also
Categories
Find more on Entering Commands in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!