# Tag Archives: computing

## And so it begins: Lab #1 in the MATLAB course

The MATLAB course began in earnest on Monday this week with our first full-length lab activity session. This was the second overall meeting, the first one being some organizational stuff and a lengthy fly-through of the main features of MATLAB. What follows is a breakdown of what we did and how it went, which also serves as an invitation for critique and suggestions in the comments.

First, some context. I intend for this course to be heavily hands-on with an emphasis on self-teaching within reasonable bounds. I laid a ground rule in the first class meeting that any question of the form “How do you do ____ in MATLAB?” was going to be met with the responses “What have you found in the MATLAB help documentation? What have you found via a Google search? What have you found out from your lab partner?” I’m not above giving hints to students in the class, but I insist that they exhaust all efforts of their own first before I come swooping in to the rescue, thereby creating a dependency upon me that makes their future, independent use of MATLAB problematic. So students have to do a considerable amount of individual work to learn basic commands and concepts before they come in to lab. Maybe I’ll blog more about that idea later, but now I want to get on to the activity itself.

First of all, students did this homework assignment in the week before the lab. The main item is to produce a graph of $y = \sin(1/x)$ from x = -1 to x = 12. The theme of the lab this week was plotting, as you’ll see. This homework item forces them to figure out the basic usage of the PLOT command in MATLAB. It also forces them to figure out that you can’t just type 1/x in MATLAB if x is a vector.

The first 10 minutes of class are spent taking a quiz over the basic elements of the homework. Then, the lab activity itself. Here it is: CMP150-Lab1 (PDF, 201Kb). The summary:

1. Reproduce a graph of a somewhat complicated function (related to the one from the homework set) with a bunch of extras added in the graph. Create a JPG and submit it.
2. Create a data set by hand and plot it, and add some extras, including a text annotation. But this time, no pointy-clicky stuff using the Plot Tools window — you have to do it all by hand from the command line and put the commands into an M-file and submit that. (The moral: You need to know how to create a plot both ways, using the pointy-clicky stuff and without using it.)
3. Create a two-item data set by hand and plot it, and make it look pretty. Create a PNG and submit it.
4. Create single plot with 6 subplots arranged in a 2×3 grid. Create a PDF and submit it.

The philosophy here is that plotting stuff is fun, and there is a kind of immediate gratification when you create something visual that will hopefully serve as a source of low-hanging fruit for beginning MATLAB users. So students learning MATLAB should be introduced to the ins and outs of basic function and data visualization before they see much of anything else. And plotting also provides a convenient inroads to talking about M-files and other important MATLAB components.

So, how did it all go? I have to admit it didn’t start well. The homework set was due at 10:30 AM on Monday, and a good portion of the submissions had a timestamp in the neighborhood of 1:30AM Monday. There were several instances of students not reviewing their notes or watching the assigned tutorial videos before starting on the homework, which they did after midnight on the day it was due. So several teams took around 30-40 minutes just to get a basic plot of $A = e^{-0.2t} \sin(2t)$ up on the screen — simply because they didn’t know how to create a vector, use the exp( ) command, or use the plot command, all of which we covered last week and in the homework.

I don’t say this to shame my students. Rather, I think it illustrates some important psychological points that play into teaching MATLAB, or any kind of technical computing topic, at this level:

• Students who are at the entry level of using technical computing software believe that the software will adapt itself to what they are thinking, rather than the harsh reality of the other way around. When students want to plot $e^x$, they should just type it the way they write it. That may be the ideal case, but MATLAB just doesn’t work that way, and that’s a big problem for some people.
• Most people who do any amount of computing will vouch for the importance of being able to surf the help files of a program to figure out what you need to do if you have something to get done. But freshmen in college have mostly never heard of such a thing. They are still making that transition from high school, where (typically) the teacher tells you what you need to know. Asking students to look up a command in a help system and then play around with it before coming into a lab session where they’ll be asked to do more of the same, is asking students to make a HUGE developmental leap. Or at least to begin to make it.
• I’ve said it before, but the notion that today’s students are digitally native is both unfounded and dangerous. My students are not unintelligent, but many of them had no idea what a PNG was or how it was different from a JPG or PDF (this week’s homework asks them to do some research on that topic); many have never seen anything like a command line; a few of them didn’t even know how to attach something to an email to submit it. The so-called and self-appointed ed tech illuminati pushing this digital native idea have simply got to come back to reality so we can teach these ideas and skills rather than assume them.

Anyway, despite the rocky start, we ended well. I softened my stance, just this once, on giving out hints and how-to advice for a couple of things, and the infusion of progress begat more progress, this time by the students themselves. Most people didn’t make it past the second problem but everybody turned in reasonably good work by the deadline this morning. And by the end, teams were getting excited that they had figured some MATLAB out.

I think we can now move forward into next week, which is about working with data files and doing basic statistics, with confidence and with a little more understanding of what this class is all about. Here’s the homework!

Filed under Education, Educational technology, MATLAB, Teaching, Technology

## MATLAB course details and update

We start classes this week, a bit later than most other folks thanks to our January term. That means the long-awaited MATLAB course will be formally kicking off. I’ve had a few people ask me about what we’re doing in this course, so here’s an update.

This has been a tricky course to plan, because the audience is definitely not the usual one for an introductory MATLAB course. Almost all the introductory textbooks and materials I reviewed for the course, and all the introductory MATLAB courses I looked at from other schools, have a particular student demographic in mind: they are all engineering majors; they are all freshmen or sophomores with either a semester of programming under their belts or at least a very high level of comfort with computers and the “guts” of programming; and they are all attending large universities in which the particular academic makeup of the institution plays little to no role in how the class is designed.

By contrast, of the 15 students enrolled right now in my course:

• 9 are freshmen; 5 are sophomores. (At least that demographic fits the profile.)
• 5 are Education majors; 3 of those are secondary education majors, the other 2 elementary education majors. There is one lone Pure Mathematics major. 9 have no declared major at all.
• Of the 9 undeclareds, two of those are students who are pursuing our dual-degree program in Engineering and just haven’t gotten around to filling out the paperwork yet.
• But that’s it: Two undocumented engineering majors; NO science majors. The plurality are Education majors, and once the undeclareds get around to declaring, this may become the majority.
• I don’t have data for this, but I am pretty sure less than half of the students have ever had any exposure to programming whatsoever. I wouldn’t be surprised to find out it’s more like 1/5 of the class with no programming experience.
• Again, no data, but I think a good portion of the students would not consider themselves comfortable around computers once we start talking about something besides basic office apps and web pages. For example, anything having to do with typing stuff into a command line. (Like much of MATLAB.)

So this is not the audience that is “supposed” to be taking a MATLAB course. They are not (for the most part) scientists and engineers, and if you start throwing the details of fprintf, memory addressing, floating point arithmetic, and so forth to them you will likely lose them.

And yet — and this has been the frustrating thing — almost all introductory MATLAB materials assume students are engineers and scientists who have no problem being thrown directly into learning about fprintf, memory addressing, and floating point arithmetic. I won’t name names or authors, and these are not bad books, but they are written with a particular assumption in mind about who is using them. And that assumption does not work for my class.

Therefore I have had to do a lot of remixing and retrofitting of existing materials in order to deliver what I think is a solid intro MATLAB course, one that I honestly think satisfies the same learning objectives as the course at our partner university (which uses one of those books I mentioned above, and it works for them because they have the “right” audience for those books), but also one that really works for the decidedly non-MATLAB-like group of students I will have.

I’ve tried to adhere to a few basic design principles when drawing up this course:

• Get students comfortable with the software and how it works before throwing them into programming. But: Don’t wait too long to begin programming.
• Connect use of the software back to the mathematics courses they know: namely Calculus I and Calculus II. (The course is a prerequisite for Calculus III and is usually taken alongside Calc II.) And take it very easy on any other kind of math in the course.
• Get them doing plots and working with data from Excel files early and often. Pictures and data: Students dig these.
• Make heavy use of the Symbolic Toolbox and get them using it early as well. And by “Symbolic Toolbox” I really mean MuPad, not the nearly-indecipherable symbolic manipulation done inside the MATLAB command line by calling the Symbolic Toolbox. This is actually quite different than how most intro MATLAB materials do it; if you see the Symbolic Toolbox at all, it’s the last chapter of the book and MuPad is never mentioned.
• Take it easy on the science content of the course and instead emphasize use of MATLAB on topics with which the majority of the class is familiar and comfortable. In the canonical audience, that would mean precisely that a lot of science ought to show up. For us, not so much.
• Have fun first, foremost, and throughout. Remember that many of the students in the course are not only unfamiliar with computers (aside from using them to check Facebook or use a word processor) but are actually scared of them — probably a greater portion of the class than will let on to it. Keep it light. If something looks more confusing than useful, it probably is; and unless there’s some compelling reason to hack through it, just drop it and cover something else.

I think that with these principles in mind, a lot of MATLAB purists would look at my course and sniff at it, thinking it’s not a “real” MATLAB course. It certainly will not walk or talk like the MATLAB course you’ll find at the typical Big Engineering School. But we’re not a big engineering school; we’re a liberal arts college, and the Liberal Arts informs what we do in every course, including a MATLAB course. I guess I am not trying to create a course that in turn creates more MATLAB purists. I am trying to create a course that shows students that programming is a great application and instantiation of critical thinking and problem solving. If they don’t know all the command line options to fprintf, but later on when confronted with a problem they first thing they think is to try out some MATLAB code to solve it, I think we’ve had a successful experience.

That’s an overview of the philosophy and design of the course. In another post, I’ll talk about the course schedule, assessments, and plans for what we’ll do in the class. This gets interesting because, as mentioned above, we’re not really using a book but rather just McGyvering a bunch of pre-existing resources to fit our particular needs.