Error related to "wden" in wavelet toolbox
1 次查看(过去 30 天)
显示 更早的评论
I try to denoise a signal with "wden" functon.
I followed the instruction and example provided by Mathwork, which is listed below:
snr = 3; init = 2055615866;
[xref,x] = wnoise(3,11,snr,init);
lev = 5;
xd = wden(x,'heursure','s','one',lev,'sym8');
Then the error message is shown:
Undefined function 'compare_strut_fieldnames' for input arguments of type 'struct'.
Error in iswtf (line 90)
tf = compare_strut_fieldnames(wtf_s, wtf);
Error in dwt (line 119)
elseif (iswtf(wtf))
Error in wavedec (line 45)
[x,d] = dwt(x,Lo_D,Hi_D); % decomposition
Error in wden (line 72)
[c,l] = wavedec(x,n,w);
It seems like Matlab cannot find the function "compare_strut_fieldnames". I suspect there is a typo that it should be "struct", not "strut". So I just copy the function "compare_struct_fieldnames" and renamed it to "compare_strut_fieldnames". But still doesn't work.
I tried other denoise function such as wdencmp, and still invalid due to the same error.
By the way, My Matlab version is R2014a.
Please Help. Thank you :)
0 个评论
采纳的回答
Wayne King
2015-1-23
Hi Steven,
This code runs correctly on R2014a.
snr = 3; init = 2055615866;
[xref,x] = wnoise(3,11,snr,init);
lev = 5;
xd = wden(x,'heursure','s','one',lev,'sym8');
I believe your issue is that you have some non-MathWorks' functions on your path preceding MathWorks functions. Because they are named the same as the MathWorks function, that is causing the issue.
For starters, please enter
>>which dwt
at the command prompt.
You should get something back like:
matlab\toolbox\wavelet\wavelet\dwt.m
If you have downloaded somebody else's version of dwt.m then that can explain the errors you are seeing.
The errors you are reporting in "compare_strut_fieldnames" or even "compare_struct_fieldnames" as well as iswtf() are not functions that exist or would be called by the code example you show. In other words, not part of the MathWorks' Wavelet Toolbox.
If you find that you are calling a dwt.m that is not in matlab/toolbox/wavelet/wavelet then please remove the folder with the non-MathWorks' dwt.m from your path, or move that function somewhere outside of the MATLAB path.
Hope that helps,
Wayne
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Discrete Multiresolution Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!