MATLAB busy for all the time after the code is executed
조회 수: 13 (최근 30일)
이전 댓글 표시
I have one more query. In my code it seems there is an infinite loop going on and the MATLAB is busy for so long that I had to stop the debugging. Initially I was facing the "array exceeding maximum array size preference" error which was in this line of the code below Step 2 : h_k = freq_signal - mean_env;. In that case, the error was likely caused by the fact that freq_signal or mean_env is a very large array. The subtraction operation between the two arrays would result in an array of the same size, which could potentially exceed MATLAB's maximum array size preference. To fix this issue, I tried breaking up the input signal into smaller segments and processing each segment separately. This would reduce the memory requirements of the operation and prevent MATLAB from running out of memory. So I did the following. Input signal freq_signal is broken up into segments of size segment_size, and the envelope() function is applied to each segment separately. The resulting mean_env arrays are then averaged to obtain the final mean_env
댓글 수: 7
Jan
2023년 3월 14일
The problem is not inside:
if max(abs(mean_env)) < 1e-10
is_imf = true;
c_j = h_k;
but that the algroithm to calcualte mean_env does not produce such small values.
You can use the debugger or some fprintf commands to track the values of upper_env, lower_env and mean_env.
답변 (1개)
Cris LaPierre
2023년 3월 13일
It sounds like you're encountering an infinite loop in your while loop. Your conditional is is_imf, so it looks like you are never entering the following condition.
if max(abs(mean_env)) < 1e-10
is_imf = true;
c_j = h_k;
This suggests your constraint is either not appropriate for your data, or there is a mistake in calculating mean_env, as the values do not match the assumptions made when writing the code.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Statistics and Linear Algebra에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!