MATLAB busy for all the time after the code is executed
14 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Jan
il 14 Mar 2023
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.
Risposte (1)
Cris LaPierre
il 13 Mar 2023
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 Commenti
Vedere anche
Categorie
Scopri di più su Statistics and Linear Algebra in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!