EGR106 Assignment # 2, Part 1

EGR106 Assignment # 2, Part 1

<p>EGR106 Assignment # 2, part 1 Due Feb. 12, 2008</p><p>Instructions – The problems in this assignment ask you to create and manipulate various arrays. Rather than just doing so at the command prompt, you are to write a script file to implement all of the requested operations. Please do the following:  Name your script using your last name followed by the assignment number, e.g. brown2.m.  The first command in your script should be a disp command to show your name and section number.  Do the problems in order.  Use pause and clc in between problems for a nice presentation. Pause allows me to view the output one problem at a time; clc erases the command window so that it is obvious what the new material is. A sample script that does most of these objectives appears on the course website (file HW2_sample.m). </p><p>When you get this script working (and please check it before sending it to me…..the most common problem students have at this point in EGR106 is that some minor error causes their submission to fail to execute), send this single file to [email protected]</p><p>1. Create a column vector with the elements 28, log(5), cos(60○), and 66.1. Create a row vector with the entries 22, π, ⅞, and 0. Create a 3 row by 5 column matrix with any non-trivial entries (you can select the values). Call this matrix A (in other words, it is a variable in the workspace). All of these are just brute force constructions.</p><p>2. Start by creating a 3-element column vector, called b, with entries 8, 3, and 7. Create c as a 5-element row vector with entries 0, 88, 11, 3, and 7. Using concatenation, create a 3 by 7 matrix D whose first and last columns are b, with A (from problem 1) in the middle. Finally, create a 5 by 5 matrix E whose first and last rows are c, with A again in the middle. Show b, c, D, and E in the command window. </p><p>3. Create a row vector whose first element is 20, with elements decreasing in increments of 5, with the last element being -60. (Use the colon operator.) </p><p>4. Create the variable F, a 3 by 3 matrix, from the center of matrix E from problem 2. (Note, do not use brute force construction; you are to use addressing on E.) </p><p>5. Create the variable G, a 2 by 3 matrix, from the first and third rows, first, second, and fourth columns of matrix E from problem 2. (Again, you are to use addressing on E.)</p>

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    1 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us