Is it possible to extract data points from what is displayed on the Array Plot block in Simulink into the base MATLAB workspace?
3 views (last 30 days)
Show older comments
The plot displayed in the Array Plot block in my Simulink model has been based on calculations using the Spectrum Estimator block such that its data points are composed of (Frequency, Power) pairs as the x-axis and y-axis data respectively (see attached image 'Array plot.JPG'). Is it possible to extract the Frequency and Power data points from this array plot to the base workspace in MATLAB? I have attempted this by linking the very same output from the Spectrum Estimator block to a 'to workspace' block (see 'Simulink model.JPG') . However, the output in the base workspace bears no resemblance to the plot in the Array Plot block (see the plot result in 'plot_from_workspace.JPG'). I typed the command plot(S) on MATLAB, where S as obtained from Simulink is a double array of dimension 52275 x 1, which is much longer than I expect as from what I know, the RBW in the 'Frequency Estimator' block divides the frequency range into only 1024 intervals.
0 Comments
Answers (1)
Fangjun Jiang
on 5 May 2023
The way you save the data points to the MATLAB base workspace is correct.
The Array Plot shows the frequency on x axle from 0 to 6e3.
The plot(S) shows the frequency on x axle from 0 to 6e4.
0 Comments
See Also
Categories
Find more on Spectral Analysis 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!