Hi Schubert,
As I can understand you are trying to display the same output that you are observing in the spectrum analyser’s spectrogram view in Simulink, in App designer.
You can use the spectrumAnalyzer function with some name value arguments to achieve the same.
Here’s an example: (I have changed this example to show the output in spectrogram view)
sin = dsp.SineWave(Frequency=100,SampleRate=1000, SamplesPerFrame=1000);
scope = spectrumAnalyzer(SampleRate=sin.SampleRate, ViewType="spectrogram");
x = sin() + 0.05*randn(1000,1);
The above script is an example from the spectrumAnalyzer function’s documentation that you can find here,
One thing important thing to remember here is that I have used the viewType name value argument to achieve the spectrogram view. You can learn more about all the name value arguments of spectrumAnalyzer from the above documentation.
You can use this script in your app as well, here’s an example on how you can add this feature to your own MATLAB app:
You can add a button in your MATLAB app and add a callback with your button.
To add callbacks to your application components, you can refer the following documentation,
Here, you can see that I have again added the code from spectrumAnalyzer’s documentation example.
After clicking the “call spectrum analyzer” button (when you’re app is running), you’ll see the spectrum analyzer pop-up in spectrogram view.
I hope this helps, thanks!