How to inhibit clear and clc at the beginning of an m-file?

3 visualizaciones (últimos 30 días)
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?

Respuesta aceptada

Image Analyst
Image Analyst el 24 de En. de 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.
  1 comentario
Bradley Champagne
Bradley Champagne el 24 de En. de 2016
Thank you for responding so quickly. I am a new user and know nothing practically. I understand what you're saying, but I discovered a major problem. I should be typing my programs in a script editor window, not the command window. This also alleviates not being able to backspace to past lines of commands. Have a good one.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Entering Commands en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by