Answers.Body: <p>I don't know Matlab, so this answer is mostly about generic programming concepts.</p>
  
  <p>The core of programming is problem solving, so I would think the best use of the limited time you have available would be to focus on computational thinking and providing them with the techniques they will need to be able to think their way around a problem sufficiently to be able to express a solution in code.</p>
  
  <p>Matlab is of course designed specifically for solving problems rooted in various Scientific, Mathematical and Engineering domains, so ideally, any example programs you use for demonstration and explaining the concepts should be as close as possible to the types of problems that the students will be solving by themselves.  </p>
  
  <p>One of the pre-requisites for being able to write the code to solve a problem is to have gained a clear understanding of the problem being solved, so it would be useful to stick to problems which the learners would already be able to understand on-paper.</p>
  
  <p>It could be useful to look at the Harvard CS50 syllabus as a starting point, it places a heavy emphasis on developing computational thinking skills by challenging learners to solve typical programming problems: <a href="https://cs50.harvard.edu/ap/syllabus/" rel="nofollow noreferrer">https://cs50.harvard.edu/ap/syllabus/</a></p>
  
  <p>Many of the concepts covered in the first 3-4 lessons of the CS50 syllabus are universally applicable to programming in any language, and David J Malan's delivery of these concepts in his lectures seems to go down very well with his students. </p>
  
  <p>A number of other specific techniques which I believe would be useful:</p>
  
  <ul>
  <li>Problem decomposition, illustrated by describing a complex problem, analysing it and dividing into sub-problems.</li>
  <li>Steps to solving a problem by starting with example/test inputs, describing the steps, and reaching a result 'by-hand'.</li>
  <li>Pattern recognition and using generalisation to describe a solution using pseudocode, then translation into a runnable program </li>
  <li>Using the debugger to set breakpoints, inspect variables and step through code to find/fix errors. </li>
  </ul>
  
  <p>Terminology, as well as the 'grammar' of the language is of course important too - there's a lot of jargon to to absorb in a very limited space of time.     </p>
  
  <p>Newcomers frequently find themselves spending a great deal of time attempting to decypher syntax errors, so some of the most important terminology for them to understand will be the words/phrases which frequently appear in the Matlab error frame - for example, misuse of particular symbols/operators, or incorrect use of particular data types. </p>
  
  <p>Perhaps finally, make sure to include frequent reminders that they can (and should) be making extensive use of Google and StackOverflow to find out what the syntax errors and other jargon means as well.   </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-28T23:23:42.793Z
Answers.LastActivityDate: 2020-02-28T23:28:45.117Z
Answers.LastEditDate: 2020-02-28T23:28:45.117Z
Answers.UserDisplayName: Ben Cottrell
Answers.Body: <p>I think I'd try to hook them with <strong>image processing</strong>. Maybe with <a href="https://en.wikipedia.org/wiki/Canny_edge_detector" rel="nofollow noreferrer">an edge detection algorithm</a> or <a href="https://en.wikipedia.org/wiki/Feature_detection_(computer_vision)#Feature_detectors" rel="nofollow noreferrer">something else along those lines</a>.</p>
  
  <p>Topics that get naturally covered:</p>
  
  <ul>
  <li>Basic syntax, data, and other features of the language</li>
  <li>Basic program structure and design (not many libraries needed, you get to cook the dark magic yourself) </li>
  <li>Matrix manipulation, (algebra and entrywise)</li>
  <li>"The scientist's approach to programming": try something, look at the result (literally in this case, because the results are pictures), and if it looks good, move on and build on that result. We're not trying to create software engineers here.</li>
  </ul>
  
  <p>Particular benefits:</p>
  
  <ul>
  <li>Matlab (or Octave) might actually be a good choice for implementing image processing algorithms in the real world, so the topic doesn't feel forced. (Somewhat unlike using Matlab for "intro to programming"..)</li>
  <li>Shows Matlab and programming as a tool for getting work done ("oh, the source image needs to be rotated?  Hold on while I whip up this nifty rotation matrix..")</li>
  <li>In case the students don't yet see matrices as the best thing since Sliced (<a href="https://en.wikipedia.org/wiki/Sliced_(TV_series)" rel="nofollow noreferrer">2019</a>), this might double as a sales pitch for matrix algebra too.</li>
  <li><strong>Pretty pictures!</strong></li>
  </ul>
  
  <p>(Really, the final bullet point is the important thing. Finding the result to an interesting physics problem just doesn't cut it as the behaviour-reinforcing reward a beginning programming student needs. With image manipulation, it's not entirely unheard of that some even fiddle with the code in their free time.)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-09T22:07:16.733Z
Answers.LastActivityDate: 2020-03-09T22:07:16.733Z
Answers.UserDisplayName: Bass
Answers.Body: <p>With only 5 sessions, I would abandon the idea of building something cool, and focus with laser-like precision on whatever they <em>need to know</em> going forward in their coursework.  There is such a small amount of time to learn the basics of any programming language.</p>
  
  <p>MatLab supports lambdas, objects, and GUI design, but unless they are going to get into rather serious programming, I imagine that you would steer clear of these.  (I don't know how you would cover any of them in 5 days with novices in any case.)</p>
  
  <p>The danger in heading towards UI and a game is that they will come out without being able to do what they presumably need in the next class, such as matrix multiplication, or graphing an integral multiplication.  You may be better using your five sessions to delve into five areas of greatest need, as determined by the future required coursework of your students.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-25T17:48:50.410Z
Answers.Text: It depends on the length of the lessons.
Answers.UserDisplayName: Buffy
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-25T17:02:31.930Z
Answers.LastActivityDate: 2020-02-25T17:02:31.930Z
Answers.UserDisplayName: Ben I.
Answers.Body: <p>I studied and TA'd electrical engineering and computer science in college and graduate school. You have a unique opportunity versus most introductory programming languages that use general languages like java or python because Matlab, which is a portmanteau for "Matrix Laboratory", is a language that is meant to be very interactive, intuitive to mathematically-savvy students, and easy to pick up and includes the constructs of 1-d vectors, 2-d matrices, and n-dimensional tensors as first-order data structures (I know you know all this, but I'm stating it for other readers who may be less familiar with this language). </p>
  
  <p>Most of your students will have a background in linear algebra and matrix notation and use in mathematics from their courses in all of the state engineering disciplines. Therefore, you can focus less on teaching fundamental of data types, data structure, control flow logic, hierarchy and namespaces, and instead build up from intuitive Matrix-like mathematical operations that naturally have sequences of repeating steps with exit conditions.</p>
  
  <ul>
  <li><p>1st-week of introduction to typical matrix problems in the engineering sciences, and walking them through building the simple scripts to execute those.</p></li>
  <li><p>2nd-week add Matlab function wrapper per file concept as an introduction to hierarchy and namespace (informally, this is how it works, not focusing on the deeper theoretical aspects) of scoping local variables in input/return values. </p></li>
  <li><p>3rd-week show how there are lots of the simple operations (like matrix multiples, inverting matrices, DFT and FFT, that are prebuilt library functions, and study some tradeoffs on choosing them and how they deal with padding, non-invertible data sets, etc.)</p></li>
  <li><p>4th and 5th-week focus on a large programming project that does something interesting with larger data and doing something iterative like gradient descent on a simple pattern match like regression, or simple cases of convex cost function search, or even backpropagation in a 3-layer neural network. </p>
  
  <p>Pre-build much of the base and helper code and have them learn how to use what they learned so far to code the inner loop of the iterations. Definitely give them the code that they can easily tweek so they get some experience generating graphics to demonstrate (and debug) the optimization iteration sequence.</p></li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-06T20:49:51.230Z
Answers.Text: This is an excellent first answer.  Welcome to [cseducators.se]!
Answers.UserDisplayName: Ben I.
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-06T20:44:18.330Z
Answers.LastActivityDate: 2020-03-06T20:48:54.520Z
Answers.LastEditDate: 2020-03-06T20:48:54.520Z
Answers.UserDisplayName: robertdrost
Answers.Body: <p>I teach programming to graduate students in public policy, with a focus on data.  So while engineering students might be different, I think there will be a lot of similarities.</p>
  
  <p>Unless you're running an intensive bootcamp where the students will be putting in far more hours than a typical class would call for (are you?), I think the biggest obstacle to doing "something cool" that you'll run into is the uneven abilities of new programmers.</p>
  
  <p>As with my field, I imagine many of your students aren't interested in programming per se; they're interested in programming only as a means to do engineering.  In a typical course, this means you're going to have some students still struggling with data types and functions after five weeks, while others are done with that after week one.</p>
  
  <p>If I were teaching a 5-week course myself (I work primarily in Python), I would probably try to have everyone building a game by the end.  Something basic, like a card game.  While the goal isn't for them to be game developers, it's something many of your students will think is "cool", which will inspire them to get a grasp of how the language works along the way.  I might then have them collect the results of iterations of the game into a dataset to do some basic data work with.</p>
  
  <p>I'm not terribly familiar with Matlab, but if that's not a suitable goal for that platform, try to get as close to the game theme as you can.  The mix of all types of engineers might make that difficult, but what about something that takes in the design of a wall, then calculations to knock it down?  I'm not an engineer, but something that is only loosely practical, fun, and a good primer of the language.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-25T16:27:11.223Z
Answers.Text: I'm guessing Python isn't an option here and that the answer appropriate for MatLab would be _essentially_ different.
Answers.UserDisplayName: Buffy
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-25T17:11:50.970Z
Answers.Text: That's rather the point of my last paragraph.  Games were merely illustrative toward the goal of introducing "cool" into a short intro programming course.  You want to add fun and easy-to-grasp intuition to what's being developed, within the scope of the language you work in.
Answers.UserDisplayName: Jeff
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-25T15:42:00.130Z
Answers.LastActivityDate: 2020-02-25T15:42:00.130Z
Answers.UserDisplayName: Jeff
Answers.Body: <p>I teach an introductory programming course, with many students who have never programmed before. My course is 13 weeks, but the first 5 cover what I consider to be the basics. I have 3 hours of lectures and 2 hours of labs per week.
  So here's a suggestion for 5 weeks:</p>
  
  <p>Week 1: The basic idea of thinking algorithmically, ordering the steps of a process. You can use the logo turtle to get them to "write some code" on day 1. (see for instance the online editor here: <a href="https://www.tortue-logo.fr/en/logo-turtle" rel="nofollow noreferrer">https://www.tortue-logo.fr/en/logo-turtle</a>). Then teach variables and expressions, decomposing an arithmetic computation in several steps (e.g. calculating how much you'll spend per month on gasoline, given the distance to your workplace, the mileage of your car, and the price of gas).</p>
  
  <p>Week 2: using if conditions and boolean expressions, with or/and. Incorporating those into algorithms. What you can code with that: things like the absolute value, compute the solutions of a second-degree equation (using built-in square root), calculate income tax in a toy setting (with several tax brackets). If time permits, start talking about loops.</p>
  
  <p>Week 3: Loops. Once you have the semantics of the while / for statements, you show them a classic algorithm such as Euclid's GCD algorithm: describe it by a flowchart and show how to translate it to code. Then move on to trying to figure out the steps of solving a problem, showing them classic techniques like using an accumulator to compute a sum (e.g. the sum of even integers between A and B).</p>
  
  <p>Week 4: Functions. How you can package a computation in a function, with inputs and related outputs. Insists on the goals of modularity, abstraction, etc.</p>
  
  <p>Week 5: Working with lists and / or matrices (since Matlab is heavily focused on matrices). By the end of it they can't do terribly "fun" stuff like games, but there are some scientific applications of interest, like a LFSR to do simple cryptography (that's what I do in my fifth-week lab). For students who aren't afraid of some math, there's plenty of useful math-oriented algorithms like approximating an integral (with rectangles or trapezes and such), using Heron's algorithm to approximate the square root, etc. I think with Matlab you can also plot graphs quite easily, so there are definitely interesting applications there.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-26T01:37:35.333Z
Answers.LastActivityDate: 2020-02-26T01:37:35.333Z
Answers.UserDisplayName: user3780968
Body: <p>I am an assistant professor preparing a 5 lecture series 'introduction to programming'. The target audience are first year engineering undergrads - from a mix of mechanical, electrical, electronic, telecomms and civil engineering majors. Some of these students will never have programmed before. We will use Matlab.</p>
  
  <p>I am expecting that many of these students will never have coded before and almost all will not have seen Matlab before. They will need Matlab in all subsequent years of their degree.</p>
  
  <p>Given the extremely limited time for this course, how can I give best bang for their buck, without it being too dry?</p>
  
  <p>Is there something cool we could work towards creating over the 5 weeks?</p>
  
  <p>More info: There are 5 x 4 hours sessions. Classroom cannot be flipped as there will be 50+ students.</p>
  
  <p>Editing here to thank everyone who has taken the time and effort to give extremely helpful detailed replies. I appreciate it guys.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-25T11:56:28.363Z
Comments.Text: Do you have the opportunity to flip the classroom with students working together when face to face with you? https://en.wikipedia.org/wiki/Flipped_classroom
Comments.UserDisplayName: Buffy
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-25T13:02:47.357Z
Comments.Text: _Matlab_ seems a poor choice for _introduction to programming_, perhaps rename the course _introduction to Matlab_. Alternatively, teach Python, it can do everything Matlab can.
Comments.UserDisplayName: user2768
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-25T13:04:33.300Z
Comments.Text: _Is there something cool we could work towards creating over the 5 weeks?_ How many teaching hours (lectures, tutorials, ...) do you have in five weeks?
Comments.UserDisplayName: user2768
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-25T13:10:21.477Z
Comments.Text: What you *need* to know depends on the courses that build off of this one. Whether that's feasible in 5 sessions is another question. But seriously: what are they going to do with their programming skills later on? That should inform your programme.
Comments.UserDisplayName: ObscureOwl
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-25T15:19:29.913Z
Comments.Text: My question above is a serious one. If you can answer it, then I might be able to offer advice.
Comments.UserDisplayName: Buffy
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-25T15:41:05.753Z
Comments.Text: It strikes me that the university may be doing something kind of unpleasant here. By only providing these students 5 classes in something that should be a full term or full one year course, they seem to be expecting the students to learn it on their own. If that's the case, it raises many questions outside of your question.
Comments.UserDisplayName: puppetsock
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-25T15:51:04.297Z
Comments.Text: @puppetsock, unless they are 3-5 hours each, as sometimes happens.
Comments.UserDisplayName: Buffy
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-25T17:03:34.497Z
Comments.Text: @Buffy Ugh.  Five 5-hour sessions wouldn't be even close to 5x as productive as 25 1-hour sessions.  That sounds horrid to me!
Comments.UserDisplayName: Ben I.
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-25T17:49:42.380Z
Comments.Text: @BenI., different in a flipped classroom, though.
Comments.UserDisplayName: Buffy
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-25T20:44:41.437Z
Comments.Text: Yeah, the "flipped classroom" is what I was talking about with expecting the students to learn on their own. And in this case, they seem to be expecting the student to *find* the on-line material as well.
Comments.UserDisplayName: puppetsock
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-27T02:10:48.927Z
Comments.Text: May be showing my age, but I remember a time when it was important to pay special attention to students who were coming from the Math department---to indoctrinate them with the idea that an assignment statement in a procedural programming language was _not_ the same thing as a mathematical equation.
Comments.UserDisplayName: Solomon Slow
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-27T14:27:51.777Z
Comments.Text: I don't know mathlab so not answering. But to the extent that mathlab is (aligned to) functional programming you may find this blog post useful: http://blog.languager.org/2012/10/functional-programming-lost-booty.html .
Comments.UserDisplayName: Rushi
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-29T08:53:42.097Z
Comments.Text: Just to second user2768's answer. Matlab isn't the correct language to teach. If you *must* teach matlap, teach octave instead. At least that when when they graduate they don't have to learn a new language/fork out thousands of pounds/dollars.
Comments.UserDisplayName: user6916458
Tags: <programming><introductory-lesson>
Title: What do programming novices need to know when using MatLab?
ThreadText: # What do programming novices need to know when using MatLab?
  
  (Asked by: username_0 on 2020-02-25)
  
  I am an assistant professor preparing a 5 lecture series 'introduction to programming'. The target audience are first year engineering undergrads - from a mix of mechanical, electrical, electronic, telecomms and civil engineering majors. Some of these students will never have programmed before. We will use Matlab.
  
  I am expecting that many of these students will never have coded before and almost all will not have seen Matlab before. They will need Matlab in all subsequent years of their degree.
  
  Given the extremely limited time for this course, how can I give best bang for their buck, without it being too dry?
  
  Is there something cool we could work towards creating over the 5 weeks?
  
  More info: There are 5 x 4 hours sessions. Classroom cannot be flipped as there will be 50+ students.
  
  Editing here to thank everyone who has taken the time and effort to give extremely helpful detailed replies. I appreciate it guys.
  
  **Tags:** programming, introductory-lesson
  
  > **Comments:**
  > **username_1**: Do you have the opportunity to flip the classroom with students working together when face to face with you? https://en.wikipedia.org/wiki/Flipped_classroom  
  > **username_2**: _Matlab_ seems a poor choice for _introduction to programming_, perhaps rename the course _introduction to Matlab_. Alternatively, teach Python, it can do everything Matlab can.  
  > **username_2**: _Is there something cool we could work towards creating over the 5 weeks?_ How many teaching hours (lectures, tutorials, ...) do you have in five weeks?  
  > **username_3**: What you *need* to know depends on the courses that build off of this one. Whether that's feasible in 5 sessions is another question. But seriously: what are they going to do with their programming skills later on? That should inform your programme.  
  > **username_1**: My question above is a serious one. If you can answer it, then I might be able to offer advice.  
  > **username_4**: It strikes me that the university may be doing something kind of unpleasant here. By only providing these students 5 classes in something that should be a full term or full one year course, they seem to be expecting the students to learn it on their own. If that's the case, it raises many questions outside of your question.  
  > **username_1**: @username_4, unless they are 3-5 hours each, as sometimes happens.  
  > **username_5**: @username_1 Ugh.  Five 5-hour sessions wouldn't be even close to 5x as productive as 25 1-hour sessions.  That sounds horrid to me!  
  > **username_1**: @BenI., different in a flipped classroom, though.  
  > **username_4**: Yeah, the "flipped classroom" is what I was talking about with expecting the students to learn on their own. And in this case, they seem to be expecting the student to *find* the on-line material as well.  
  > **username_6**: May be showing my age, but I remember a time when it was important to pay special attention to students who were coming from the Math department---to indoctrinate them with the idea that an assignment statement in a procedural programming language was _not_ the same thing as a mathematical equation.  
  > **username_7**: I don't know mathlab so not answering. But to the extent that mathlab is (aligned to) functional programming you may find this blog post useful: http://blog.languager.org/2012/10/functional-programming-lost-booty.html .  
  > **username_8**: Just to second username_2's answer. Matlab isn't the correct language to teach. If you *must* teach matlap, teach octave instead. At least that when when they graduate they don't have to learn a new language/fork out thousands of pounds/dollars.  
  
  ---
  
  ## 6 answers
  
  ### Answer by username_5 on 2020-02-25. Score: 5
  
  With only 5 sessions, I would abandon the idea of building something cool, and focus with laser-like precision on whatever they *need to know* going forward in their coursework. There is such a small amount of time to learn the basics of any programming language.
  
  MatLab supports lambdas, objects, and GUI design, but unless they are going to get into rather serious programming, I imagine that you would steer clear of these. (I don't know how you would cover any of them in 5 days with novices in any case.)
  
  The danger in heading towards UI and a game is that they will come out without being able to do what they presumably need in the next class, such as matrix multiplication, or graphing an integral multiplication. You may be better using your five sessions to delve into five areas of greatest need, as determined by the future required coursework of your students.
  
  > **Comments:**
  > **username_1**: It depends on the length of the lessons.  
  
  ---
  
  ### Answer by username_11 on 2020-03-06. Score: 2
  
  I studied and TA'd electrical engineering and computer science in college and graduate school. You have a unique opportunity versus most introductory programming languages that use general languages like java or python because Matlab, which is a portmanteau for "Matrix Laboratory", is a language that is meant to be very interactive, intuitive to mathematically-savvy students, and easy to pick up and includes the constructs of 1-d vectors, 2-d matrices, and n-dimensional tensors as first-order data structures (I know you know all this, but I'm stating it for other readers who may be less familiar with this language).
  
  Most of your students will have a background in linear algebra and matrix notation and use in mathematics from their courses in all of the state engineering disciplines. Therefore, you can focus less on teaching fundamental of data types, data structure, control flow logic, hierarchy and namespaces, and instead build up from intuitive Matrix-like mathematical operations that naturally have sequences of repeating steps with exit conditions.
  
  * 1st-week of introduction to typical matrix problems in the engineering sciences, and walking them through building the simple scripts to execute those.
  * 2nd-week add Matlab function wrapper per file concept as an introduction to hierarchy and namespace (informally, this is how it works, not focusing on the deeper theoretical aspects) of scoping local variables in input/return values.
  * 3rd-week show how there are lots of the simple operations (like matrix multiples, inverting matrices, DFT and FFT, that are prebuilt library functions, and study some tradeoffs on choosing them and how they deal with padding, non-invertible data sets, etc.)
  * 4th and 5th-week focus on a large programming project that does something interesting with larger data and doing something iterative like gradient descent on a simple pattern match like regression, or simple cases of convex cost function search, or even backpropagation in a 3-layer neural network.
  
    Pre-build much of the base and helper code and have them learn how to use what they learned so far to code the inner loop of the iterations. Definitely give them the code that they can easily tweek so they get some experience generating graphics to demonstrate (and debug) the optimization iteration sequence.
  
  > **Comments:**
  > **username_5**: This is an excellent first answer.  Welcome to [cseducators.se]!  
  
  ---
  
  ### Answer by username_12 on 2020-02-25. Score: 2
  
  I teach programming to graduate students in public policy, with a focus on data. So while engineering students might be different, I think there will be a lot of similarities.
  
  Unless you're running an intensive bootcamp where the students will be putting in far more hours than a typical class would call for (are you?), I think the biggest obstacle to doing "something cool" that you'll run into is the uneven abilities of new programmers.
  
  As with my field, I imagine many of your students aren't interested in programming per se; they're interested in programming only as a means to do engineering. In a typical course, this means you're going to have some students still struggling with data types and functions after five weeks, while others are done with that after week one.
  
  If I were teaching a 5-week course myself (I work primarily in Python), I would probably try to have everyone building a game by the end. Something basic, like a card game. While the goal isn't for them to be game developers, it's something many of your students will think is "cool", which will inspire them to get a grasp of how the language works along the way. I might then have them collect the results of iterations of the game into a dataset to do some basic data work with.
  
  I'm not terribly familiar with Matlab, but if that's not a suitable goal for that platform, try to get as close to the game theme as you can. The mix of all types of engineers might make that difficult, but what about something that takes in the design of a wall, then calculations to knock it down? I'm not an engineer, but something that is only loosely practical, fun, and a good primer of the language.
  
  > **Comments:**
  > **username_1**: I'm guessing Python isn't an option here and that the answer appropriate for MatLab would be _essentially_ different.  
  > **username_12**: That's rather the point of my last paragraph.  Games were merely illustrative toward the goal of introducing "cool" into a short intro programming course.  You want to add fun and easy-to-grasp intuition to what's being developed, within the scope of the language you work in.  
  
  ---
  
  ### Answer by username_13 on 2020-02-26. Score: 2
  
  I teach an introductory programming course, with many students who have never programmed before. My course is 13 weeks, but the first 5 cover what I consider to be the basics. I have 3 hours of lectures and 2 hours of labs per week.
  So here's a suggestion for 5 weeks:
  
  Week 1: The basic idea of thinking algorithmically, ordering the steps of a process. You can use the logo turtle to get them to "write some code" on day 1. (see for instance the online editor here: <https://www.tortue-logo.fr/en/logo-turtle>). Then teach variables and expressions, decomposing an arithmetic computation in several steps (e.g. calculating how much you'll spend per month on gasoline, given the distance to your workplace, the mileage of your car, and the price of gas).
  
  Week 2: using if conditions and boolean expressions, with or/and. Incorporating those into algorithms. What you can code with that: things like the absolute value, compute the solutions of a second-degree equation (using built-in square root), calculate income tax in a toy setting (with several tax brackets). If time permits, start talking about loops.
  
  Week 3: Loops. Once you have the semantics of the while / for statements, you show them a classic algorithm such as Euclid's GCD algorithm: describe it by a flowchart and show how to translate it to code. Then move on to trying to figure out the steps of solving a problem, showing them classic techniques like using an accumulator to compute a sum (e.g. the sum of even integers between A and B).
  
  Week 4: Functions. How you can package a computation in a function, with inputs and related outputs. Insists on the goals of modularity, abstraction, etc.
  
  Week 5: Working with lists and / or matrices (since Matlab is heavily focused on matrices). By the end of it they can't do terribly "fun" stuff like games, but there are some scientific applications of interest, like a LFSR to do simple cryptography (that's what I do in my fifth-week lab). For students who aren't afraid of some math, there's plenty of useful math-oriented algorithms like approximating an integral (with rectangles or trapezes and such), using Heron's algorithm to approximate the square root, etc. I think with Matlab you can also plot graphs quite easily, so there are definitely interesting applications there.
  
  
  ---
  
  ### Answer by username_9 on 2020-02-28. Score: 1
  
  I don't know Matlab, so this answer is mostly about generic programming concepts.
  
  The core of programming is problem solving, so I would think the best use of the limited time you have available would be to focus on computational thinking and providing them with the techniques they will need to be able to think their way around a problem sufficiently to be able to express a solution in code.
  
  Matlab is of course designed specifically for solving problems rooted in various Scientific, Mathematical and Engineering domains, so ideally, any example programs you use for demonstration and explaining the concepts should be as close as possible to the types of problems that the students will be solving by themselves.
  
  One of the pre-requisites for being able to write the code to solve a problem is to have gained a clear understanding of the problem being solved, so it would be useful to stick to problems which the learners would already be able to understand on-paper.
  
  It could be useful to look at the Harvard CS50 syllabus as a starting point, it places a heavy emphasis on developing computational thinking skills by challenging learners to solve typical programming problems: <https://cs50.harvard.edu/ap/syllabus/>
  
  Many of the concepts covered in the first 3-4 lessons of the CS50 syllabus are universally applicable to programming in any language, and David J Malan's delivery of these concepts in his lectures seems to go down very well with his students.
  
  A number of other specific techniques which I believe would be useful:
  
  * Problem decomposition, illustrated by describing a complex problem, analysing it and dividing into sub-problems.
  * Steps to solving a problem by starting with example/test inputs, describing the steps, and reaching a result 'by-hand'.
  * Pattern recognition and using generalisation to describe a solution using pseudocode, then translation into a runnable program
  * Using the debugger to set breakpoints, inspect variables and step through code to find/fix errors.
  
  Terminology, as well as the 'grammar' of the language is of course important too - there's a lot of jargon to to absorb in a very limited space of time.
  
  Newcomers frequently find themselves spending a great deal of time attempting to decypher syntax errors, so some of the most important terminology for them to understand will be the words/phrases which frequently appear in the Matlab error frame - for example, misuse of particular symbols/operators, or incorrect use of particular data types.
  
  Perhaps finally, make sure to include frequent reminders that they can (and should) be making extensive use of Google and StackOverflow to find out what the syntax errors and other jargon means as well.
  
  
  ---
  
  ### Answer by username_10 on 2020-03-09. Score: 0
  
  I think I'd try to hook them with **image processing**. Maybe with [an edge detection algorithm](https://en.wikipedia.org/wiki/Canny_edge_detector) or [something else along those lines](https://en.wikipedia.org/wiki/Feature_detection_(computer_vision)#Feature_detectors).
  
  Topics that get naturally covered:
  
  * Basic syntax, data, and other features of the language
  * Basic program structure and design (not many libraries needed, you get to cook the dark magic yourself)
  * Matrix manipulation, (algebra and entrywise)
  * "The scientist's approach to programming": try something, look at the result (literally in this case, because the results are pictures), and if it looks good, move on and build on that result. We're not trying to create software engineers here.
  
  Particular benefits:
  
  * Matlab (or Octave) might actually be a good choice for implementing image processing algorithms in the real world, so the topic doesn't feel forced. (Somewhat unlike using Matlab for "intro to programming"..)
  * Shows Matlab and programming as a tool for getting work done ("oh, the source image needs to be rotated? Hold on while I whip up this nifty rotation matrix..")
  * In case the students don't yet see matrices as the best thing since Sliced ([2019](https://en.wikipedia.org/wiki/Sliced_(TV_series))), this might double as a sales pitch for matrix algebra too.
  * **Pretty pictures!**
  
  (Really, the final bullet point is the important thing. Finding the result to an interesting physics problem just doesn't cut it as the behaviour-reinforcing reward a beginning programming student needs. With image manipulation, it's not entirely unheard of that some even fiddle with the code in their free time.)
  
  
  ---
  
  