You are on page 1of 2

CMPSC 200 Fall 2013 Lab 1 Due at the end of your class time on 9/6/13 Worth 8 points

Create a single *.m file (a script file) that completes the problems listed below Problem 1: Material Scientists are often interested in developing materials with specific properties. One scientist want to design materials that have zero change in net volume and a zero change in net surface area as they are heated to 500 degrees. The scientist has developed a material that has a cubic unit cell (length = width = height and angles are 90 degrees) at room temperature. Upon heating the material changes to a tetragonal unit cell (length = width, but height is different, the angles remain 90 degrees). At 500 degrees the value of length (and width) is the 0.8 times the height of the tetragonal unit cell. Create a row vector containing at least 6 values for the length (= width = height) values of the cubic unit cell at room temperature. Calculate what the length (=width) and height would be for the tetragonal cells at 500 degrees if the volume remained constant. Calculate what the length (=width) and height would be for the tetragonal cells at 500 degrees if the surface area remained constant.

Problem 2 : a. Create 4 individual row vectors using the linspace command (you will need 4 commands, one for each vector) which contain the following values (each row represents what should be in each vector). Please note that the third row represents angles in radians and consequently is in multiples of PI. Your command for this row should use the defined variable pi. 75 0 0 300 50 90 1.5708 250 25 180 3.1416 200 0 270 4.7124 150 -25 360 6.2832 100 -50 450 7.8540 50 -75 540 9.4248 0

(hint: the third vector contains angles in radians) b. Use a single command to combine these vectors into a table in which the values of the row vectors are contained in columns. (the first few rows of the table are given below) 75.0000 0 0 300.0000 50.0000 90.0000 1.5708 250.0000 25.0000 180.0000 3.1416 200.0000 Do not use any concepts beyond Chapter 3 of your text book and store all your values in variables other than the default variable ans.

Make sure that you add comments at beginning of your *.m file that includes your name, section number, and what this assignment is (Lab 1, Project 1, etc.) Also include comments before the set commands for each problem that specify which problem you are solving, what is the purpose of the problem, what input is used, what output is expected and what processing is required (input processing and output should be clearly specified!) You may also use comments to state what a command is supposed to due if you believe it is unclear. Do not store any input or results in the default variable ans. Upload your completed *.m file in the Lab 1 drop box in the Labs folder on ANGEL by the end of your class time on 9/6. If you do not get both problems finished, upload what you have so you will get partial credit. Labs are not accepted late. Please take the time to confirm your submission. (If you do not know how to confirm your submission, please review the Submissions to ANGEL document posted on ANGEL.) You may make multiple submissions to the same drop box on ANGEL, the last one submitted will be graded, earlier submissions will be ignored.

You might also like