You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-6Lines changed: 14 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,7 @@
1
-
# Programming: Structuring Code [](https://www.mathworks.com/matlabcentral/fileexchange/115905-programming-structuring-code)
1
+
# Programming: Structuring Code
2
+
[](https://www.mathworks.com/matlabcentral/fileexchange/115900-programming-organizing-data) or
3
+
[](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Programming-Structuring-Code&project=StructuringCode.prj)
4
+
2
5
**Curriculum Module**
3
6
_Created with R2021b. Compatible with R2021b and later releases._
These scripts can be used as part of a lecture, as activities in an instructional setting, or as interactive assignments to be completed outside class.
9
12
10
-
Get started with the Programming: Structuring Code interactive examples by downloading and unzipping the repository. Then, double-click the StructuringCode.prj file inside MATLAB®. From there, you can follow the landing page instructions to get started with the examples. The instructions inside the live scripts will guide you through the exercises and activities. Get started with each live script by running it one section at a time. To stop running the script or a section midway (for example, if a loop is running longer than intended), click the <imgsrc="https://user-images.githubusercontent.com/88841524/182219991-17ef7bf9-369b-4463-8de6-9e440ca3bc9b.png"> **Stop** button in the **RUN** section of the **Live Editor** tab in the MATLAB Toolstrip.
13
+
##Get started with the Programming: Structuring Code interactive examples##
14
+
by downloading and unzipping the repository. Then, double-click the StructuringCode.prj file inside MATLAB®. From there, you can follow the landing page instructions to get started with the examples. The instructions inside the live scripts will guide you through the exercises and activities. Get started with each live script by running it one section at a time. To stop running the script or a section midway (for example, if a loop is running longer than intended), click the <imgsrc="https://user-images.githubusercontent.com/88841524/182219991-17ef7bf9-369b-4463-8de6-9e440ca3bc9b.png"> **Stop** button in the **RUN** section of the **Live Editor** tab in the MATLAB Toolstrip.
11
15
12
16
## Prerequisite Domain Knowledge ##
13
17
This module assumes familiarity with basic programming concepts such as floating point doubles and strings, structures including constants, vectors, matrices, and arrays, and control flows including if/else, for loops, and while loops, as well as how to use them in MATLAB. These ideas are all presented with interactive examples in [Fundamentals of Programming](https://www.mathworks.com/matlabcentral/fileexchange/103225-fundamentals-of-programming).
14
18
15
19
## Details ##
16
20
17
-
**Functions.mlx**
21
+
**Functions.mlx**[](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Programming-Structuring-Code&project=StructuringCode.prj&file=Functions.mlx)
22
+
18
23
Organizing code into functions improves the readability, reusability, and ease of testing. This script addresses built-in functions, refactoring code to create functions, local functions, functions defined in their own files, programmatic scope and the MATLAB path, and how to pass functions as arguments to other functions.
@@ -27,7 +32,8 @@ In this script, students will...
27
32
- pass functions as arguments by using function handles.
28
33
29
34
## ##
30
-
**Debugging.mlx**
35
+
**Debugging.mlx**[](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Programming-Structuring-Code&project=StructuringCode.prj&file=Debugging.mlx)
36
+
31
37
Everyone makes mistakes when coding or interacting with computer programs, but you can fix these mistakes. This script introduces the MATLAB Code Analyzer, errors, warnings, breakpoints, stepping, and other tools for minimizing errors as well as identifying and removing bugs from your programs.
**CommentingCode.mlx**[](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Programming-Structuring-Code&project=StructuringCode.prj&file=CommentingCode.mlx)
49
+
43
50
Clearly documenting and communicating your thinking is essential to program with others or even your future self. This script addresses why and how you should document and comment your code.
@@ -51,7 +58,8 @@ In this script, students will...
51
58
52
59
## ##
53
60
54
-
**SharingCode.mlx**
61
+
**SharingCode.mlx**[](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Programming-Structuring-Code&project=StructuringCode.prj&file=SharingCode.mlx)
62
+
55
63
Writing code for yourself is the first step, but when you create something useful or interesting, you also need to know how to share your work with others. This script offers a brief introduction to sharing your code with others.
0 commit comments