필터 지우기
필터 지우기

Ski Jump HELPPPP

조회 수: 1 (최근 30일)
Reelz
Reelz 2012년 5월 1일
댓글: Image Analyst 2020년 9월 22일
I want to design this:
The ski jump starts at a height of h feet and finishes at a launch point height of eh feet, where height is represented by the variable y. From the start (x = 0) to the launch point, the ski jump extends a horizontal distance of d feet. A skier using the jump will begin horizontally and will fly off the end at a sa degree angle from the horizontal. Develop the set of equations to determine the four coefficients of a cubic polynomial y = f(x) for the side
view of the ski jump that meets the specifications above. Write a script to compute and display these coefficients, using methods described in class to solve a set of linear equations.
I want to plot this as well.
Here's my code, its effed up though I need help on assigning these values because every try is a failure!
A = [ 0 0 0 1 ];
d^3 d^2 d 1;
0 0 1 0;
3*d^2 2*d 1 0];
b = [100; 10; 0; tan(30*pi/180)];
format short e;
c = A\bx == 0:d;
y = polyval(c,x);
plot(x,y)

답변 (2개)

Walter Roberson
Walter Roberson 2012년 5월 1일
Try removing the ']' from the first line. And make sure you define d before that first line.
You need to define your variable "bx".
Why are you comparing A\bx to the vector of integers from 0 to d ?

Leah
Leah 2012년 5월 1일
I'm pretty sure you want to set up A as the system of linear equations like this
A=[0 0 0 1; 1 1 1 1; 0 0 1 0; 3 2 1 0]
b = [100; 10; 0; tan(30*pi/180)];
c=A\b
d=4*pi
x=1:.1:d
y = polyval(c,x);
plot(x,y)
It also seems that x=0:d, the range you want to evaluate your polynomial over. I'm not sure what that is so i made up some numbers.
Like Walter said always make sure you define variable in the right order. You can't use them until you create them.
  댓글 수: 2
Rahul Karelia
Rahul Karelia 2020년 9월 22일
Thank you leah, can u show what kind of Graph you get when you run this Code ?
Image Analyst
Image Analyst 2020년 9월 22일
It works, did you try it Rahul?
A = [0 0 0 1; 1 1 1 1; 0 0 1 0; 3 2 1 0]
b = [100; 10; 0; tan(30*pi/180)];
c = A\b
d = 4*pi
x = 1:.1:d
y = polyval(c,x);
plot(x,y, 'b-', 'LineWidth', 2);
xlabel('x', 'FontSize', 22);
ylabel('y', 'FontSize', 22);
title('y vs. x', 'FontSize', 22);
grid on;

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by