Clear Filters
Clear Filters

Error using newly added wavelet to wavemngr

23 views (last 30 days)
Dejan Vlasakov
Dejan Vlasakov on 17 Jul 2024 at 14:29
Commented: Umar on 18 Jul 2024 at 1:00
I am working with a tool in matlab that matches an orthogonal wavelet to a given prototype signal. The attatched image depicts the information stored within the waveletFilter structure generated by the tool.
I would like to add the f/g filters to wavemngr(). I begin by saving f and calling the .mat file by the wavelet short name I plan to use. I then run the following script:
wsname = 'L1F';
wname = 'L1OptimizedFilter';
eval([wsname '=waveletFilterL1.f/sqrt(2);']);
save(wsname, wsname);
wavemngr('add', wname, wsname, 1, '', [wsname '.mat']);
When I use wavemngr('read') to validate the addition of my filter, it is there.
However, when I then proceed to access any information regarding the properties, or use the filter with a given transform, I get an error message saying my filter has not been found.
  4 Comments
Walter Roberson
Walter Roberson on 17 Jul 2024 at 23:39
Please read http://www.mathworks.com/matlabcentral/answers/304528-tutorial-why-variables-should-not-be-named-dynamically-eval for information about why we strongly recommend against creating variable names dynamically.
Umar
Umar on 18 Jul 2024 at 1:00
Hi Dejan,
There seems to be discrepancies in your statements, You mentioned, I would like to add the f/g filters to wavemngr(). I begin by saving f and calling the .mat file by the wavelet short name I plan to use. I then run the following script: wsname = 'L1F'; wname = 'L1OptimizedFilter'; eval([wsname '=waveletFilterL1.f/sqrt(2);']); save(wsname, wsname); wavemngr('add', wname, wsname, 1, '', [wsname '.mat']); So, could you share the script code for wname = 'L4F’
Then, you mentioned, “when I then proceed to access any information regarding the properties, or use the filter with a given transform, I get an error message saying my filter has not been found.” But the screenshot that you have shared for error message contradicts with your statement,it is telling you that you are using invalid wavelet name, it sounds like either you ran the code earlier using invalid wavelet name and sharing this new line of code tobj=wpdec(s,5,”L40optimizedFilter”); because this does not making any sense saying and you are declaring “L4OptimizedFilter” but that does not mean filter not found. Error using wavemngr,invalid wavelet name “l40optimizedfFilter” So, there is mismatch in problem description mentioned by you. Now, your recent comments mentioned that you are facing problems with both filters but not clear about if errors are the same. So, my suggestion would be edit your comments sharing the right filter name with errors, sharing the code file which is causing the error. The more details you will provide will help me troubleshoot your problem better.

Sign in to comment.

Answers (0)

Products


Release

R2024a

Community Treasure Hunt

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

Start Hunting!