How do I debug my live script?

8 次查看(过去 30 天)
Can I place break points in my live script to perform debugging as I would with regular script files?

采纳的回答

MathWorks Support Team
Visual debugging is not supported as of the current release (R2016a), but you can perform command line debugging – e.g:
 
>> dbstop myfile.mlx
>> myfile
>> dbstep
You will see your output and figures in their traditional form.
 

更多回答(1 个)

Jon
Jon 2017-11-25
Am I to assume this is still true for 2017b?
JHS
  2 个评论
Jon
Jon 2017-11-30
I am running 2017b and don't see any menus for setting breakpoints. Also right clicking on lines doesn't give the possibility of introducing breakpoints. I find this very limiting. In general, I do not like the idea of having separate editors. There should just be one editor, and if you want you can turn on the "Live Script" features. Actually at the moment it seems like there are at least three separate editors The regular editor, the Live Script editor, and the App Builder editor. You end up with code in all of these separate editors and then have to open each one individually, and try to remember where the code for each part lives. Hopefully some further integration of these pieces will come soon. I especially would like to be able to debug my Live Scripts
Steven Lord
Steven Lord 2018-2-23
adams13, I'm not quite sure what you mean when you say 'it gets totally useless if a "life script"[sic] is stored in a binary compressed form.'
If you're using the comparison tool in MATLAB (the Compare button on the Home tab of the Toolstrip or the visdiff function), it should be able to compare two live scripts and show you the differences.
If you're using some other source control tool with release R2016b or later you can configure it to use the MATLAB Comparison tool (which knows how to compare live scripts, MAT-files, and Simulink models) to diff and merge live scripts.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Debugging and Analysis 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by