MATLAB: Transfer data from a figure to variable

simulinkspectrum frequency plot transfer data

Hi,
I'm using Matlab Simulink to simulate the behavior of a electric circuit.
I obtain the average transfer function by using "averaging spectrum analyzer" block. What i need to do is to obtain the data of this average transfer function. I mean, i want to obtain in a vector x the range of frequency and in a vector y the range of gain.
How can i do it?
Thanks in advanced, NĂ©stor

Best Answer

open axes proprieties of your figure,then click "more proprieties"
  1. select the second plot then click "more proprieties" you will find your data in xdata and ydata
  2. do the same to the third plot
be sur that you select the plot (not only the box)
x=get(gco,'XData');y=get(gco,'YData');