フィルターのクリア

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 Center および File ExchangeProgramming についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by