Why am i getting negative numbers?

%Set Values
g = 9.8; %m/s^2
v = [10, 12, 14, 16, 18, 20]; %m/s
theta = [0, 0, 50, 60, 70, 80]; %degress
%Set Equation
h= v.^2.*sin(theta)./2.*g;
%Make the table
T = array2table(h);
disp (T)
this is supposed to be the height of a ball so I don't think that I should be getting negative numbers.

回答 (1 件)

the cyclist
the cyclist 2017 年 6 月 25 日
編集済み: the cyclist 2017 年 6 月 25 日

1 投票

The sin() function takes input in radians. Use sind() for input arguments in degrees.

1 件のコメント

nr0003
nr0003 2017 年 6 月 25 日
Thanks! I forgot that I had to put d for degrees.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

タグ

質問済み:

2017 年 6 月 25 日

編集済み:

2017 年 6 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by