Ctrl+Enter versus. Clicking Run

34 Ansichten (letzte 30 Tage)
David
David am 6 Okt. 2013
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 Kommentar
Jan
Jan am 6 Okt. 2013
Bearbeitet: Jan am 6 Okt. 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.

Melden Sie sich an, um zu kommentieren.

Antworten (2)

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

Jan
Jan am 6 Okt. 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.

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by