필터 지우기
필터 지우기

Transfer data from a figure to variable

조회 수: 4 (최근 30일)
Néstor Monedero
Néstor Monedero 2012년 9월 6일
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

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2012년 9월 6일
편집: Azzi Abdelmalek 2012년 9월 7일
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');
  댓글 수: 5
Azzi Abdelmalek
Azzi Abdelmalek 2012년 10월 27일
Néstor, be sur to click on the plot, not just on the windows, you will see your points highlighted. when you are done go to matlab command and write
x=get(gco,'XData');y=get(gco,'YData');
Néstor Monedero
Néstor Monedero 2012년 10월 27일
Thanks Azzi.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Robert Cumming
Robert Cumming 2012년 9월 7일
to do it without interacting with the mouse at all you can get to the data through the children of the axes handle: e.g.
figure;
plot ( magic(10) );
axes_children = get ( gca, 'children' );
axes_lines = findobj ( axes_children, 'type', 'line' );
xdata = get ( axes_lines, 'xdata' )
ydata = get ( axes_lines, 'ydata' )
  댓글 수: 4
Azzi Abdelmalek
Azzi Abdelmalek 2012년 9월 7일
It was said in his question. that's what "averaging spectrum analyzer" do
Robert Cumming
Robert Cumming 2012년 9월 7일
Ok - I've never used that so wouldn't know... You learn something new everyday :)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Scopes and Data Logging에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by