# 3rd order polynomials in MATLAB?

조회 수: 19 (최근 30일)
Teddy Xiong 2012년 10월 19일
Need help with problem. I am very confused. Don't know where to start and this question is very hard for me. I tried getting started with
function[coeff lp fd] = SkiJump(l,h0,hf,s0,sf)
coeff=[]
lp= minmax(SkiJump)
fd= hf-20
plot(h0,s0)
but I am just too confused. I missed class due to sickness and i still have to turn in my homework and now I have no idea how to do anything concerning linear equations.
THis is the question
You have been hired as an intern at a ski resort. Your first intern project is to create a new design for a ski jump. Your boss is a big fan of 3rd order polynomials and therefore wants you to design the ski jump based on a 3rd order polynomial. For initial design purposes, your boss wants you to write a MATLAB function called SkiJump which will be used to evaluate the feasability of the design.
The equations of the 3rd order polynomial H(x) and the slope s(x) are defined below:
H(x)=p3x3 +p2x2 +p1x+p0
s(x) = 3p3x2 + 2p2x + p1
*The function header should look like the following:*
function [coeff lp fd] = SkiJump(l,h0,hf,s0,sf)
The inputs to the function are:
the horizontal distance from the start to the launch point (in feet).
h0: the initial height (in feet).
hf: the final height (in feet).
s0: the initial slope (in feet/feet). Must be less than or equal to zero.
sf: the final slope (in feet/feet). Must be greater than or equal to zero.
The outputs from the function are:
coeff: a vector containing the coefficients of the 3rd order polynomial. The coefficients
must be arranged from p3 to p0.
lp: the lowest point of the ski jump design.
fd: the ski jumper’s flying distance.
*To calculate fd assume the following:*
(a) Gravitational acceleration = 32.1522 ft/s2
(b) Neglect ground and air frictions and use conservation of energy in determining the speed of the skier when he/she leaves the jump.
(c) Assume that the ground is at height hf-20 feet.
In addition, the function should also plot the shape of the new ski jump, which is given in figure 1.

댓글을 달려면 로그인하십시오.

### 답변 (2개)

Image Analyst 2012년 10월 19일
Take a look at polyfit() and polyval(). You may also find interp1() helpful.
##### 댓글 수: 2없음 표시없음 숨기기
Dr. Seis 2012년 10월 19일
편집: Dr. Seis 2012년 10월 19일
I don't think polyfit or interp1 will be able to take into account both the height and slope information simultaneously... or will they?
Image Analyst 2012년 10월 19일
I don't know - I didn't go over it in detail. I just saw something about trying to get coefficients from a 3rd order polynomial so polyfit() popped into mind.

댓글을 달려면 로그인하십시오.

Dr. Seis 2012년 10월 19일
편집: Dr. Seis 2012년 10월 19일
My answer for a different, but similar question might help (at least for the function for the ramp):

댓글을 달려면 로그인하십시오.

### 카테고리

Help CenterFile Exchange에서 Polynomials에 대해 자세히 알아보기

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by