Why do I receive an error when I use the NTHROOT function within MATLAB?
조회 수: 4 (최근 30일)
이전 댓글 표시
When I execute the following command:
r = nthroot(1,2)
I receive the following error message:
??? Error using ==> nthroot
If X is negative, N must be an odd integer.
However, my value for X is not negative.
채택된 답변
MathWorks Support Team
2009년 6월 27일
This bug has been fixed for Release 14 SP1 (R14SP1). For previous releases, read below for any possible workarounds:
This is a bug within MATLAB 7.0 (R14) in the NTHROOT function.
To work around this issue, perform the following steps.
1. In the MATLAB Command Window, type:
edit nthroot
2. Within the file that comes up in the MATLAB Editor/Debugger, replace line 17:
if any((x(:) < 0) & ((n(:) ~= fix(n(:)))) | rem(n,2)==0)
with the command:
if any((x(:) < 0) & (((n(:) ~= fix(n(:)))) | rem(n,2)==0))
3. Save the MATLAB file.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Analog Signal Generation에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!