Trying add chunk of data to a array
이전 댓글 표시
답변 (1개)
Steve Eddins
2020년 11월 4일
1 개 추천
As I understand the code, the fact that ls is empty after the loop implies that either:
- The while loop body never executes
- The if body never executes; or
- z is empty in the assignment ls = [ls z];
You haven't shown us how the values of x or i or Nfft get set, so we can only make educated guesses about the specific cause.
I suggest that you single-step through the code using the debugger. At each line, check the values of the key variables and make sure that each one contains what you think it should.
댓글 수: 5
AJ Woodson
2020년 11월 4일
AJ Woodson
2020년 11월 4일
Steve Eddins
2020년 11월 4일
Yep. The if-body never executes because i+win <= length(x) is never true.
AJ Woodson
2020년 11월 4일
AJ Woodson
2020년 11월 4일
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!