ENGR 132 - QUIZ3

# ENGR 132 - QUIZ3 - 4/24/11 ENGR 132 Thurs/Tues 9:30-11:30...

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

Click to edit Master subtitle style 4/24/11 ENGR 132 Wed/Fri 3:30-5:30

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

View Full Document
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.
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

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

View Full Document
Click to edit Master subtitle style

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

View Full Document
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 &lt; triangle (left) r red x x-mark &gt; 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

## This note was uploaded on 04/23/2011 for the course ENGR 132 taught by Professor Kutson during the Spring '11 term at Purdue University-West Lafayette.

### Page1 / 6

ENGR 132 - QUIZ3 - 4/24/11 ENGR 132 Thurs/Tues 9:30-11:30...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online