Ctrl+Enter versus. Clicking Run

34 visualizaciones (últimos 30 días)
David
David el 6 de Oct. de 2013
Editada: Subin Kuttappan Stellal Mary el 9 de Dic. de 2015
What is the difference between executing a code with the use of crtl+enter versus clicking run at the top of the toolbar?
[EDITED, Jan, copied from answer section]
Sorry that I wasn't clear.
Sometimes when I use crtl+enter, I receive errors that I would not if I clicked on run. These errors are specific to the code. In one of my codes, I constantly received the error "function is not defined" or something along those lines, but the function WAS defined. I had no problem running this code by clicking run.
  1 comentario
Jan
Jan el 6 de Oct. de 2013
Editada: Jan el 6 de Oct. de 2013
Please add important information inside the original question, where readers find them immediately. The section for answers should be reserved for solutions or suggestions. Thanks.
Do the "function not defined" messages concern subfunctions in the currently opened M-file or in its folder? While "Run" or F5 runs the file in its folder, other M-files are found there even if the folder is not part of the Matlab's path.

Iniciar sesión para comentar.

Respuestas (2)

Subin Kuttappan Stellal Mary
Subin Kuttappan Stellal Mary el 9 de Dic. de 2015
Editada: Subin Kuttappan Stellal Mary el 9 de Dic. de 2015
Ctrl+Enter execute a block of code (between two lines starting with %%)
Run or 'F5' executes the entire file.

Jan
Jan el 6 de Oct. de 2013
I do not know corresponding points in the documentation, but only tried a little bit in the editor:
  1. "Run" or F5 requires the file to be saved
  2. F5 allows to define input arguments
  3. Ctrl-Enter runs the code without saving also.
Do you observe other differences? Perhaps a more useful answer can be given if you explain the problem you have.

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by