フィルターのクリア

where is the mistake?

2 ビュー (過去 30 日間)
Julia
Julia 2012 年 11 月 5 日
I'm trying to get this anonymous function to work bur no matter how I do it it keeps telling me that there is something wrong with the parenthesis or brackets. What can I do to fix this?
a=45; g=9.82; v=9.0;
>> throwfun = @(x) x.*tan(a)-((g*x.^2)/(2(v*cos(a))^2));
Error: Unbalanced or unexpected parenthesis or bracket.

採用された回答

Thomas
Thomas 2012 年 11 月 5 日
You missed the * after 2 in the last terms
use
throwfun = @(x) x.*tan(a)-((g*x.^2)/(2*(v*cos(a))^2));
  1 件のコメント
Julia
Julia 2012 年 11 月 5 日
THANKS!!!!!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumeric Types についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by