{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ENGR 132 - QUIZ3

ENGR 132 - QUIZ3 - ENGR 132 Thurs/Tues 9:30-11:30 Quiz 3 1...

Info icon This preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Click to edit Master subtitle style 4/24/11 ENGR 132 Wed/Fri 3:30-5:30
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
4/24/11 Quiz 3 We want to write a function in Matlab called car_motion. There are two input arguments, velocity and acceleration. There are two output arguments, distance and time. Write the function definition line for this function.
Image of page 2
4/24/11 Solution function [distance, time] = car_motion(velocity, acceleration) +1 for writing function +1 for having two output args separated by commas +1 for having output args in [] +1 for having the function name +1 for having two input args separated by commas +1 for having input args in () +1 for having an equal sign +3 for having everything in the correct order ie function [] = function_name() If they use other names for the variables that is fine, as long as it is clear they are representing the correct inputs/ outputs
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Click to edit Master subtitle style
Image of page 4
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 4/24/11 ENGR 132 Thurs/Tues 9:30-11:30 4/24/11 Quiz 3 1. A function has the following function definition line function [area_c, circumference_c] =circle_calcs(radius) a) What is the function name? b) What are the input argument(s) c) What are the output argument(s) 2. When do we use data markers on plots? 4/24/11 Solution 1) a) circle_calcs b) radius c) area_c, circumference_c 2) Use markers for plotting experimental data 3) plot(time,height, ‘rv’) +2 +2 +2 +2 +2 ‘rv’ - or any marker they like – here is the list of colors/markers from Matlab help b blue . point ^ triangle (up) g green o circle < triangle (left) r red x x-mark > triangle (right) c cyan + plus p pentagram m magenta * star h hexagram y yellow s square k black d diamond w white v triangle (down)...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern