CS368 Homework 1
| ||
AnnouncementsCheck here periodically.
| ||
ProblemsTo get started, download this MATLAB script: Save the script (e.g., in a MATLAB/homework1 folder - if you don't have a homework1 folder, you can create one when you save the file). Launch MATLAB and open the homework1.m script. The file is a text-only file that opens in the Editor window in MATLAB. Edit your homework1.m file with your name and answers to the problems. Part 1: (5 points) Learn@UW SurveyLog on to Learn@UW and take the 5-question survey. You can get to the survey by selecting "Quizzes" from the "Assignments" pull-down menu in the red banner at the top of the main 368 page. Part 2: (14 points) Writing MATLAB commandsQuestion 1 (7 points)Write exactly one assignment statement to create each of the following vectors or matrices. Assume that any variables appearing on the left side of an assignment statement do not exist prior to the assignment statement being executed. To receive full credit, you may only make use of the built-in MATLAB functions ones, zeros, eye, and diag as well as MATLAB operators (such as *, +, :, or ' ). You may not give the vector or matrix explicitly (or use loops). For example, to create xx = 1 2 3 4 5 6 The code xx = 1 : 6 is acceptable; the code xx = [1, 2, 3, 4, 5, 6] is not.
Question 2 (7 points)Suppose the variable data, info, and vec have been defined as follows: data = [ 2 7 4 3; 3 4 7 6; 8 3 5 1; 1 4 2 6; 7 2 2 5 ]; info = [ 1 2 3 4; 3 2 4 1; 2 4 1 3; 4 3 1 2 ]; vec = [ 4 1 9 5 6 3 2 7 8 ]; Use MATLAB's matrix element access syntax to complete each of the following actions using only one assignment statement. To receive full credit, you may only use MATLAB's matrix element access, the : operator, and the transpose (') operator.
Style and Technique (1 point)Part of your score on this (and, really, every) assignment is based on your style and technique. Included in this are the following:
| ||
Handing in
In order for your work to be considered to have been turned in on-time, you must complete the survey and upload your file to your Learn@UW Dropbox by 11:59 pm Monday, February 8. | ||
Last Updated: 1/31/2016 © 2016 Beck Hasti, hasti@cs.wisc.edu |