Hello Doyeon,
I understand that you are trying to visualize the power spectrum of a sine wave using the 'Spectrum Analyzer' block in Simulink. I also note that you have used the 'Signal Generator' block for generating your sine wave and used a 'Zero-Order Hold' block for discretizing the continous signal. Your chosen signal is a pure sinusoid with unit amplitude and frequency, and zero phase. You desire to set a sampling rate of 10 Hz and perform the simulation for 10 seconds. Besides, asper my understanding, you are seeing a flat line on the 'Spectrum Analyzer' instead of the expected impulses at frequencies -1 and 1 as given in the figure attached with the question.
In this case, one possible way to achieve the desired result is by using the 'Sine Wave' block from 'DSP System Toolbox/Sources'. I would allow you to directly set the required format for the time-domain signal. This ensures that the input is correctly interpreted as a time-domain signal with a specific number of samples, allowing the 'Spectrum Analyzer' block to perform spectral analysis and display the frequency content of the input signal accurately.
I have attached below the snapshots showing the model set up and corresponding block properties for your reference:
Note that the 'signal frequency' and 'sample time' is set as per your requirement (1 Hz and 0.1 seconds respectively). The 'Samples per frame' is the number of consecutive samples from each sinusoid to buffer into the output frame, specified as a positive scalar integer.
Further, the block parameter settings for the 'Spectrum Analyzer' is given below.
For a better understanding of the 'Spectrum Analyzer' block in Simulink, you can additionally refer to the following MathWorks Documentation link:
I hope this helps you resolve the issue and gain better understanding of the 'Spectrum Analyzer' block in Simulink.