Question

A group of physics students collected data from a test of the projectile motion problem that was analyzed in a previous lab e
The linfit function creating a general tool for linear regression of data For the following problems, you will first create a
Display text on plot as part of legend. legend Measured data, r2text) 6. Evaluating the function. Test your function from t
and include statements in the main program (after the function call) that will add a title and axis labels to the graph creat
0 0
Add a comment Improve this question Transcribed image text
Answer #1

%4 subparts at a time

Vo=10:5:30;
theta=[35,45,60];
tof=[1.2 1.71 2.26 3.15 3.42;1.49 2.11 2.81 3.72 4.28;1.85 2.69 3.42 4.45 5.24];

%1
figure
plot(Vo,tof(1,:),'*')
xlabel('Initial Velocity Vo (m/s)')
ylabel('Time of Flight (s)')
grid on

%2
linear_output = interp1(Vo,tof(1,:),17);
spline_output = spline(Vo,tof(1,:),17);
fprintf('Tflight calculated using Linear interpolation at Vo = 17 and theta = 35: %f\n',linear_output)
fprintf('Tflight calculated using Spline interpolation at Vo = 17 and theta = 35: %f\n',spline_output)


%3
figure
plot(Vo,tof(1,:),Vo,tof(2,:),Vo,tof(3,:))
legend('\theta = 35','\theta = 45','\theta = 60')
xlabel('Initial Velocity Vo (m/s)')
ylabel('Time of Flight (s)')

%4
interpolated_2d = interp2(Vo,theta,tof,22,40);
fprintf('Tflight calculated using 2d interpolation at Vo = 22 and theta = 40: %f\n',interpolated_2d)

CUIdilu VIHUUW >>> tof_123 Tflight calculated using Linear interpolation at Vo = 17 and theta = 35: 1.930000 Tflight calculat

> can I get number 7

Caleb Pardo Thu, Sep 30, 2021 10:03 PM

Add a comment
Know the answer?
Add Answer to:
A group of physics students collected data from a test of the projectile motion problem that...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Example 1: Least Squares Fit to a Data Set by a Linear Function. Compute the coefficients of the ...

    Example 1: Least Squares Fit to a Data Set by a Linear Function. Compute the coefficients of the best linear least-squares fit to the following data. x2.4 3.6 3.64 4.7 5.3 y| 33.8 34.7 35.5 36.0 37.5 38.1 Plot both the linear function and the data points on the same axis system Solution We can solve the problem with the following MATLAB commands x[2.4;3.6; 3.6;4.1;4.7;5.3]; y-L33.8;34.7;35.5;36.0;37.5;38.1 X [ones ( size (x)),x); % build the matrix X for linear model %...

  • A wind tunnel test conducted on an airfoil section yielded the following data between the lift...

    A wind tunnel test conducted on an airfoil section yielded the following data between the lift coefficient (CL) and the angle of attack (?): 12 1.40 16 1.71 20 1.38 de CL 0.11 0.55 0.95 You are required to develop a suitable polynomial relationship between ? and CL and fit a curve to the data points by the least-squares method using (a) hand calculations and (b) Matlab programming Hint: A quadratic equation (parabola) y(x)-aa,x +a x' can be used in...

  • MATLAB Problem HW7P2 (20 points) (5 pts) Write a user-defined MATLAB function called HW7P2_fn for the...

    MATLAB Problem HW7P2 (20 points) (5 pts) Write a user-defined MATLAB function called HW7P2_fn for the following math function 3 o-0.47x The input to the function is x and the output is y. Write the function such that x can be an array (use element-by-element operations) (15 pts) Use the function in (a) the command window to calculate y(-2) and y(5) (b) a script file HW7P2.m to determine y(x) for 0.001 Sx S 10 with 1000 points. Hint: Use the...

  • MATLAB, please provide code script Objective: Create a function file that animates projectile motion defined by...

    MATLAB, please provide code script Objective: Create a function file that animates projectile motion defined by the following equations in a subplot. Your function should accept user inputs of launch speed and launch angle. The output of your function will be a top subplot that displays height (y) as a function of x. The bottom subplot should display the vertical velocity while the projectile is in motion. A video of what your animation should look like is posted with this...

  • Nay programming languge is fine (MatLab, Octave, etc.) This is the whole document this last picture...

    Nay programming languge is fine (MatLab, Octave, etc.) This is the whole document this last picture i sent is the first page 5. Write and save a function Sphere Area that accepts Radius as input argument, and returns SurfaceArea (4 tt r) as output argument. Paste the function code below. Paste code here 6. Validate your Sphere Area function from the command line, checking the results against hand calculations. Paste the command line code and results below. 7. Design an...

  • I want the math lab code for theses problems in a unique way

    I want the math lab code for theses problems in a unique way Theory A projectile is launched from point A up an incline plane that makes an angle of 10 with the horizontal. The mountain is 6,000 m high. Vo 10° Figure 1: Flightpath of a projectile. If we neglect the air resistance, the flight path of a projectile launched at an initial speed vo and an angle θ of departure relative to the horizontal is a parabola (see...

  • USE R STUDIO The stackloss data frame available in R contains 21 observations on four variables...

    USE R STUDIO The stackloss data frame available in R contains 21 observations on four variables taken at a factory where ammonia is converted to nitric acid. The first three variables are Air.Flow, Water.Temp, and Acid.Conc. The fourth variable is stack.loss, which measures the amount of ammonia that escapes before being absorbed. Read the help file for more information about this data frame. - Give a numerical summarization of each column of the dataset, then use boxplots to help illustrating...

  • 3) Develop a Matlab function to compute the velocity v of a particular projectile as a...

    3) Develop a Matlab function to compute the velocity v of a particular projectile as a function of time t. In this problem, the velocity profile is described by a piecewise function, and is parameterized by 11 parameters, a, b, c, d, g, h, k, m, n, p, and q, as at - bt, 05158 c-dt, 851516 v(t;a,b,c,d,g,h,k,m,n, p,q) = gt +h(t – k)?, 1651526 me=n(t-p), > 26 else. Your Matlab function must take as input the current time value...

  • Exercise 1. For this exercise use the bdims data set from the openintro package. Type ?bdims to r...

    Exercise 1. For this exercise use the bdims data set from the openintro package. Type ?bdims to read about this data set in the help menu. Of interest are the variables hgt (height in centimeters), wgt (weight in kilograms), and sex (dummy variable with 1-male, 0-female). Since ggplotO requires that a categorical variable be coded as a factor type in R, run the following code: library (openintro) bdíms$sex2 <-factor (bdins$sex, levels-c (0,1), labels=c('F', 'M')) (a) Use ggplot2 to make a...

  • In a certain type of metal test specimen, the normal stress on a specimen is known...

    In a certain type of metal test specimen, the normal stress on a specimen is known to be functionally related to shear resistance. The following is a set of coded experimental data on the two variables. Read the data provided in the table above, into R as two vectors. Produce an appropriate plot to observe the linear relationship between the two variables. Produce an appropriate linear regression model in R, for the data provided. Normal Stress, x Shear Resistance, y...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT