how to disable the picture

Hi, every time I run the following code, a figure is generated. How can I disable it?
Thanks.
a0 = 0.05; a1 = 0.1; b1 = 0.85;
nu = randn(2300,1);
epsi = zeros(2300,1);
h = zeros(2300,1);
for i=2: 2300
h(i) = a0 + a1 * epsi(i-1)^2 + b1 * h(i-1) ;
epsi(i) = nu(i) * sqrt(h(i));
end
yt = zeros(2300,1);
for i=1: 2300
yt(i) = epsi(i)*epsi(i);
end
order = 15;
m = arx(yt, order);

댓글 수: 7

Image Analyst
Image Analyst 2013년 2월 18일
편집: Image Analyst 2013년 2월 18일
I ran it up through the arx() function and it produced no figure. It must get produced in arx(). What is that function? Is it in some toolbox that you forgot to list in the Products below, like the MATLAB coder which you listed in the Tags?
dav
dav 2013년 2월 18일
편집: Image Analyst 2013년 2월 19일
Sorry a part of the code was missing in my first question
here's the code again.. It is the corr function of the residuals
a0 = 0.05;
a1 = 0.1;
b1 = 0.85;
nu = randn(2300,1);
epsi = zeros(2300,1);
h = zeros(2300,1);
for i=2: 2300
h(i) = a0 + a1 * epsi(i-1)^2 + b1 * h(i-1) ;
epsi(i) = nu(i) * sqrt(h(i));
end
yt1 = zeros(2300,1);
for i = 1 : 2300
yt1(i) = epsi(i)*epsi(i);
end
yt=yt1(1301:2300);
order = 15;
m = arx(yt1, order);
r = resid([yt1(1:order);yt1], m);
r = r(order+1:end);
Walter Roberson
Walter Roberson 2013년 2월 19일
I do not understand what this question has to do with the Mathworks product that converts MATLAB code to C or C++ code? You tagged this with "MATLAB Coder" ?
Image Analyst
Image Analyst 2013년 2월 19일
And I still don't get a spurious figure, or any figure at all. It runs up until the call to arx() and then bombs. Again, what toolbox is arx() in? I guess it doesn't matter though since whatever toolbox it's in, I don't have it, but others who might want to help you might want to know this so they don't waste their time too. Or is arx() some custom m-file you wrote?
Walter Roberson
Walter Roberson 2013년 2월 19일
arx() appears to be in Systems Identification but that does not appear to me to plot anything.
dav
dav 2013년 2월 19일
I am sorry its in the system identification tool box
Walter Roberson
Walter Roberson 2013년 2월 19일
Have you tried using the debugger and stepping through the code to find out which command is generating the plot ?

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

답변 (2개)

Youssef  Khmou
Youssef Khmou 2013년 2월 19일

1 개 추천

hi,
your code does not produce any figure,
but if you want, you can add the following at the end of your code :
close;
Rajiv Singh
Rajiv Singh 2013년 2월 19일

1 개 추천

It is the RESID command that is bringing up the plot. It belongs to System Identification Toolbox. To make it work as documented (no figures when called with output arguments), use an IDDATA object to represent the data, as in:
r = resid(iddata([yt1(1:order);yt1]), m);
Calling RESID with double vector representing data is supported for backward compatibility. However, in this mode, the plot also gets shown since this was the behavior in the past before IDDATA object was introduced (I believe in ver 5).

댓글 수: 1

dav
dav 2013년 2월 21일
편집: dav 2013년 2월 21일
thnks. but the problem is that now I dont get the residuals either... can u fix that please?
I need to get the residuals in to a vector (r). But when i type r at the command prompt I dont see the residuals.
thanks

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

카테고리

도움말 센터File Exchange에서 Simulation and Prediction에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

질문:

dav
2013년 2월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by