make dynamic spectogram in axes in GUI

1 view (last 30 days)
Kalonymus
Kalonymus on 8 Sep 2015
Answered: Geoff Hayes on 9 Sep 2015
hello everyone!
I have program in matlab with timer that each moment the GUI should be updated according to the sound. I'll introduce you the instructions which works and the instructins which not.
at first I did the following in the timer function:
plot(t,y1,'parent',handles.axes4)
ylim(handles.axes4,[-1 1]);
This instructions works properly.
and then I tried to do the following instructions:
spectrogram(handles.axes4,y1, 32,16,2048*4,Fs,'yaxis','parent',handles.axes4)
colormap hot;
but this isn't work and I cant see the spectogram in the axes
(when I don't write the 'parent',handles.axes4" so it's show me the spectogram in other figure but I want to see it in the axes of the GUI
I tried to write:
axes(handles.axes4);
spectrogram(handles.axes4,y1, 32,16,2048*4,Fs,'yaxis');
but It's not work either.
The note that I received is:
Error while evaluating TimerFcn for timer 'timer-45'
Too many input arguments.
what is the problem?

Answers (1)

Geoff Hayes
Geoff Hayes on 9 Sep 2015
Kalonymus - according to the documentation of spectrogram there doesn't appear to be a property that allows you to specify a target axes. When you run your above code and try to specify an axes, you mention that it doesn't work. Are you observing any errors, and if so, what are they?

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!