Can I debug code when I have the student version?

I have purchased the student version, and I cannot find how to set breakpoints. Any help is much appreciated.

Antworten (2)

Walter Roberson
Walter Roberson am 16 Mär. 2018

0 Stimmen

The Student version has no restriction on setting breakpoints. You can use dbstop or you can click on the thin "-" symbol in the editor between the line number and the code.

5 Kommentare

Sarah Ngo
Sarah Ngo am 16 Mär. 2018
I cannot find anything about debugging in my tool bar. Do you know how I can get it there?
Walter Roberson
Walter Roberson am 16 Mär. 2018
Bearbeitet: Walter Roberson am 16 Mär. 2018
In the Editor window, the debugging commands will not show up until you have started running the code.
See the "-" between the 1 and the code, or between the 2 and the code? If you click on those "-" you can set a breakpoint on that line.
If the file has not been saved since its most recent change then a grey circle will replace the dash, indicating that the breakpoint is not in effect yet: it will not go into effect until you save the file. Then it will turn red.
Then for scripts you can click on the Run button
For functions you generally need to go down to the command line and invoke the function passing in appropriate parameters.
Sarah Ngo
Sarah Ngo am 16 Mär. 2018
Thanks. I have an error that doesn’t make since. So I was hoping to debug before it. I’ll comment that out and hopefully I’ll be able to see values before that line
If you have syntax errors then the editor might not permit you to run the code.
Steven Lord
Steven Lord am 17 Mär. 2018
If you show us a small segment of your code around where the error message indicates the error occurs along with the whole error message (everything displayed in red when you try to run the code) we may be able to offer some guidance about why MATLAB isn't letting you debug your file.

Melden Sie sich an, um zu kommentieren.

Sarah Ngo
Sarah Ngo am 17 Mär. 2018

0 Stimmen

Thanks for all of your help. I did have a function call that I created. However, the the code that I was calling it is was saved as a live script and not a code file. I did re-save it and now all the debugging features show up.

1 Kommentar

Steven Lord
Steven Lord am 18 Mär. 2018
The ability to debug live scripts (and live functions) was introduced in release R2018a.

Melden Sie sich an, um zu kommentieren.

Kategorien

Gefragt:

am 16 Mär. 2018

Kommentiert:

am 18 Mär. 2018

Community Treasure Hunt

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

Start Hunting!

Translated by