Can't find the error in my code

1 回表示 (過去 30 日間)
Yency Perez
Yency Perez 2020 年 9 月 18 日
コメント済み: Yency Perez 2020 年 9 月 18 日
Hello everyone,
First I want to thank any help :).
I'm having trouble with my code, please help:
TS = @(x) 1 - 4*x + 4*x^2 - 2.67*x^3 + 1.33*x^4;
p1 = 1;
p2 = 0;
RelErr1 = abs ( (TS(p1) - 2*(exp^(-2*p1))) / (2*(exp^(-2*p1))));
RelErr2 = abs ( (TS(p2) - 2*(exp^(-2*p2))) / (2*(exp^(-2*p2))));
Sorry about the two thousand parenthesis, they represent my frustation :).

採用された回答

madhan ravi
madhan ravi 2020 年 9 月 18 日
exp^ to exp
  1 件のコメント
Yency Perez
Yency Perez 2020 年 9 月 18 日
I'm crying of happiness, thanks so much!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTraveling Salesman (TSP) についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by