{"id":316,"date":"2009-06-08T13:12:14","date_gmt":"2009-06-08T13:12:14","guid":{"rendered":"https:\/\/blogs.mathworks.com\/desktop\/2009\/06\/08\/using-the-cell-mode-toolbar\/"},"modified":"2009-06-08T13:12:14","modified_gmt":"2009-06-08T13:12:14","slug":"using-the-cell-mode-toolbar","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/community\/2009\/06\/08\/using-the-cell-mode-toolbar\/","title":{"rendered":"Using the cell mode toolbar"},"content":{"rendered":"<p>The MATLAB Editor is great because supports many different workflows and user styles. Even though I call myself an advanced MATLAB user, I have long since stopped being surprised when I find out about something that has been there forever and is quite blatant in the UI. There are just some things that I don&#8217;t need to use in my normal work, but may be quite useful to others. One such thing is the <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2009a\/techdoc\/index.html?\/access\/helpdesk\/help\/releases\/R2009a\/techdoc\/matlab_env\/brqxeeu-259.html#brqxeeu-290\">cell mode toolbar<\/a>. If the toolbar is not already present in the editor, you can activate it from the menu: Cell -> Enable Cell Mode. <\/p>\n<div align=\"center\">\n<img decoding=\"async\" align=\"center\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/michael_katz_cell_mode_toolbar\/cellmode_toolbar.png\" alt=\"cell mode toolbar\"\/>\n<\/div>\n<p>The first two items on the toolbar are the ones I use a lot. They are evaluate current cell (Ctrl+Enter) and evaluate cell and advance to next (Ctrl+Shift+Enter). This is great for live demos, where you can put a single concept (of multiple commands) in a cell and then step through a file one cell at a time. The demo workflow also fits nicely with publishing, where each step of the demo publishes into a separate section. Just remember that evaluating a cell evaluates the enclosed commands in the base workspace, which is not necessarily the same workspace as if the file were run regularly. <\/p>\n<p>The next two sections of the toolbar have a textbox surrounded by either a &#8220;+,-&#8221; or a &#8220;x,%&#8221;. It&#8217;s not obvious what to do with these. If you place the caret in the editor next to a number or select a number, then the +,-,x,% buttons will light up. Pressing them will increment\/decrement or multiply\/divide the selected number by the amount in the box and reevaluate the current cell. This is good for tweaking a numerical parameter, such as a coefficient, tolerance, or number of iterations\/interpolations. In this example I&#8217;m tweaking the <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2009a\/techdoc\/ref\/peaks.html\"><tt>peaks<\/tt><\/a> input, which produces a nice visual change on each increment.<\/p>\n<div align=\"center\">\n<img decoding=\"async\" align=\"center\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/michael_katz_cell_mode_toolbar\/increment.png\" alt=\"cell mode toolbar\"\/>\n<\/div>\n<p>The next two buttons <span style=\"color:green;\">%%<\/span> are a little more obvious but their icons are subtly different. The first one <img decoding=\"async\" align=\"center\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/michael_katz_cell_mode_toolbar\/add_divider.gif\"\/> has a plus &#8220;+&#8221; in the icon and clicking it inserts a new cell marker. It&#8217;s handy to have that for the mouse, but I find it faster to type &#8220;%%&#8221;. The second one <img decoding=\"async\" align=\"center\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/michael_katz_cell_mode_toolbar\/cell_titles.gif\"\/> provides you a dropdown list of the cells in your file, the same way the function dropdown <img decoding=\"async\" align=\"center\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/michael_katz_cell_mode_toolbar\/editor_function_dropdown.png\"\/> provides a list of functions in the file. <\/p>\n<p>And remember, you can always customize the buttons that show up on the cell mode toolbar: File -> Preferences -> Toolbars -> Editor Cell Mode.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The MATLAB Editor is great because supports many different workflows and user styles. Even though I call myself an advanced MATLAB user, I have long since stopped being surprised when I find out&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/community\/2009\/06\/08\/using-the-cell-mode-toolbar\/\">read more >><\/a><\/p>\n","protected":false},"author":38,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[9,6,18],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/316"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/users\/38"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/comments?post=316"}],"version-history":[{"count":0,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/316\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/media?parent=316"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/categories?post=316"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/tags?post=316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}