Exploring your data with datatips
In the spirit of encouraging you to try out cell mode, lets look at a feature that will help you keep your focus in the editor while crafting your cells.
As I mentioned in an a previous blog entry (Running functions with input from the Editor in R2007b) I find it extremely useful to access all the information I need for a particular task from one location. This is less disruptive to my workflow, which means less context switching – and that means I get more work done!
We’ve already seen how MATLAB’s cell mode lets you group sections of code and then interactively run them each in any sequence you choose. (I’ve got something to cell you). This is really helpful when experimenting with your code – but there’s still an unnecessary step in your workflow. After each run of the cell, you have to switch focus over to the Workspace Browser and inspect your variables to ensure everything is in good order. You can eliminate that context switch by turning on datatips.
Datatips allow you to mouse over any variable defined in the base workspace and view its contents. In fact, if you do much debugging, you may have already noticed this feature as it gets turned on during debug sessions.
To turn on datatips in edit mode, goto Preferences -> Editor/Debugger -> Display and select Enable datatips in edit mode.
Now when a variable is defined in your workspace, you can mouse over it in the editor and view its contents like this:
Note also that with datatips-in-edit-mode turned on, datatips will popup in any M-file your editing (not just those using cells).
Explore your data!
- Category:
- Editor,
- Preferences
Comments
To leave a comment, please click here to sign in to your MathWorks Account or create a new one.