Display spectrogram on axes GUI [before 2017b version]
2 ビュー (過去 30 日間)
古いコメントを表示
Hi, I'm having compatibility problems regarding the spectrogram function when displaying it on a GUI file axes. With the code below it runs well on 2017b. But in R2017a it throws the following error:
Struct contents reference from a non-struct array object.
Error in pspectrogram>displayspectrogram (line 179)
if strcmp(hRotate.State,'off')
Error in pspectrogram (line 86)
displayspectrogram(t,f,P,isnormfreq,faxisloc,esttype,threshold);
Error in spectrogram (line 168)
pspectrogram({x},'spect',varargin{:});
Error in testResults>testResults_OpeningFcn (line 83)
axes(handles.axes5); spectrogram(Y,[], [], [], fs);
Im using the code below:
axes(handles.axes5); spectrogram(Y,[], [], [], fs);
where fs is the sampling frequency and Y signal that i want to analyze.
It's supposed to be like this [Picture using R2017b];

0 件のコメント
回答 (1 件)
Giacomo Echevers
2018 年 6 月 20 日
After a long struggle trying to figure out how to solve this, I believe I've understood what's the issue here.
This particular error:
Struct contents reference from a non-struct array object.
Error in pspectrogram>displayspectrogram (line 179)
if strcmp(hRotate.State,'off')
Is trying to tell us that the structure hRotate isn't actually a structure or maybe it is empty. As a matter of fact, the latter option is what I believe is happening. The structure hRotate refers to the "Rotate 3D" Toolbar option in a regular figure, which is apparently necessary to perform a spectrogram using said function. So what I think might be the solution is to include that toolbar option in your GUI and that should solve the problem.
Cheers.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Bartlett についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!