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 CenterFile Exchange에서 Traveling Salesman (TSP)에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by