SUNY Geneseo Department of Computer Science
CSci 120, Spring 2014
Prof. Doug Baldwin
Complete by Monday January 27 (Monday recitation)
or Wednesday January 29 (Wednesday recitation)
More than being the name of a programming language, “Matlab” is also the name of a computer application through which you use the language. As an application, Matlab offers you a set of windows and menus through which you can either use Matlab interactively, like a glorified calculator that responds to commands typed to it, or create and run Matlab programs. This lesson gives you some practice using this Matlab environment, and some exposure to terminology associated with it.
Preparatory material for this lesson is as follows. Please read or watch all of these before coming to class:
Answer the following groups of questions, using Matlab to find or test your answers wherever possible.
What does Matlab’s diary
command do? What about the clc
command? How do you issue commands such as these to Matlab?
In your own words, what is Matlab’s “path”? Why does the path matter to you as a Matlab user? How can you change the path?
How would you find out if Matlab has a command that does nothing? (Such a command would be strange, but not completely useless—for example a program that controls an automatic door probably has to wait for a sensor to indicate a person near the door, and while waiting it does nothing. In the early days of computing such a command was called a “no-op,” today it might be described as a “null command” or “null statement.”) Does Matlab have such a command?
See if you can get Matlab to act as a simple calculator, for example see if you can get it to tell you what 1 + 2, or some similarly trivial expression, is. (This question is really setting the stage for the next lesson; none of the readings or lectures for this one explicitly talk about doing arithmetic in Matlab. But you can do at least some arithmetic just by typing the “natural” thing in the right place….)
In your study group’s first face-to-face meeting with me following your “Complete By” date above, I will look over your answers to the questions, ask you any further questions I have, and answer any questions from you. I may also ask you to demonstrate some of your answers in Matlab. Please bring short written answers to each question to the meeting. This will speed the meeting along, but because we will also be talking face-to-face, the written answers don’t have to be long or elaborate.
If you aren’t already signed up for a study group meeting during the week following this recitation, please sign up. Make the meeting 15 minutes long, and try to make it at a time all members of your study group can attend. If no such time exists, make it at a time the greatest number of members can attend.