Error in wavedec2 Function

3 views (last 30 days)
Hello,
I've been using this function up and until yesterday. Since today wavedec2 is throwing an error saying that 'Lo_D' is an Unrecognized Function or Variable. This is the error it throws up:
Unrecognized function or variable 'Lo_D'.
Error in wavedec2 (line 9)
[x,h,v,d] = dwt2(x,Lo_D,Hi_D); % decomposition
Error in WaveletCompress_V4 (line 24)
[C,S] = wavedec2(X, n, wname);
Let's forget about my code. It throws the same error even for procedures through the Wavelet Analyzer App. It's like this function doesn't work for me anymore or so. Kindly do help me fix this. Thanks.

Accepted Answer

Pratyush Roy
Pratyush Roy on 30 Sep 2021
Hi Benjamin,
The following steps might be helpful:
Before modifying the search path, it is important to take a backup of your 'pathdef.m' file, which can be located by using the command:
>> which -all pathdef
Before proceeding, ensure that you make a safe copy of the file by copying it to a folder outside of your MATLAB path.
After taking the backup, please execute the following commands in the MATLAB Command Window to restore the default MATLAB search path and rehash the toolbox cache:
>> restoredefaultpath
>> rehash toolboxcache
After this step, please use MATLAB/Simulink to see if the issue occurs again. If the issue is resolved, then you may want to save the new MATLAB search path by executing the following command:
>> savepath
NOTE: This will remove any custom paths you may have created. The following MATLAB Answers post is an additional resource on how to back them up:https://www.mathworks.com/matlabcentral/answers/166871-how-will-running-the-restoredefaultpath-and-savepath-commands-affect-my-custom-paths-and-how-do-i-ba
Hope this helps!

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!