summaryrefslogtreecommitdiffhomepage
path: root/matlab.html.markdown
diff options
context:
space:
mode:
authorYi Hong Ang <ang.yi.hong@gmail.com>2016-06-26 20:45:45 +0800
committerven <vendethiel@hotmail.fr>2016-06-26 14:45:45 +0200
commit9d17f8bc578c96bda52bd2611625bacb8b518afb (patch)
treed9084be477c9fb218c04587696100e8eb794be03 /matlab.html.markdown
parentebd74da99a73d9cbdba23285afc745a740a87e28 (diff)
Add a section on code sections/cells (#1855)
Diffstat (limited to 'matlab.html.markdown')
-rw-r--r--matlab.html.markdown17
1 files changed, 17 insertions, 0 deletions
diff --git a/matlab.html.markdown b/matlab.html.markdown
index ddc0cb40..51b7bd4e 100644
--- a/matlab.html.markdown
+++ b/matlab.html.markdown
@@ -25,6 +25,23 @@ like
this
%}
+% Two percent signs denote the start of a new code section
+% Individual code sections can be run by moving the cursor to the section followed by
+% either clicking the "Run Section" button
+% or using Ctrl+Shift+Enter (Windows) or Cmd+Shift+Return (OS X)
+
+%% This is the start of a code section
+% One way of using sections is to separate expensive but unchanging start-up code like loading data
+load myFile.mat y
+
+%% This is another code section
+% This section can be edited and run repeatedly on its own, and is helpful for exploratory programming and demos
+A = A * 2;
+plot(A);
+
+%% Code sections are also known as code cells or cell mode (not to be confused with cell arrays)
+
+
% commands can span multiple lines, using '...':
a = 1 + 2 + ...
+ 4