bug in the function
조회 수: 1 (최근 30일)
이전 댓글 표시
What do I need to write in f2 (u1, u2) so that I do not have the error :
Undefined function or variable 'ETA'.
댓글 수: 0
답변 (1개)
Cris LaPierre
2021년 1월 14일
What is ETA?
You cannot use a variable you have not defined. Perhaps you think this variable is loaded by data.mat, but apparently not.
댓글 수: 7
Cris LaPierre
2021년 1월 15일
The problem is when your for loop counter is 7, the value of d in f4 is a single number. However, in computing ETA, you use d(end-1). Since there is only a single value, end-1=0, which causes the error that you see.
Cris LaPierre
2021년 1월 15일
These types of errors are difficult if not impossible to spot by just inspecting your code. The best way to track down the issue is to learn how to use the debugger.
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!