필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Cannot understand about this

조회 수: 2 (최근 30일)
Byeongchan Min
Byeongchan Min 2020년 4월 25일
마감: MATLAB Answer Bot 2021년 8월 20일
Below is my code:
When I proceed this, I can get 2 lines, one of which I cannot understand.
1st one is an expected, diverging line to negative infinity, but the other I get is y=x+1 line...
Where is it from?? I cannot figure it out :(
Moreover if I add plot of z11 as well using plot(z11, '-k.') and hold on,
z11 plot also follows the y=x+1 line, while it never does alone!!!! OMG WHY IS IT
a=2.95; x11=0.5; x12=-0.001; i=0;
z11=[i x11]; z12=[i x12];
while i<50
y11=f(a,x11); y12=f(a,x12);
x11=y11; x12=y12; i=i+1;
z11=[z11; [i y11]]; z12=[z12; [i y12]];
end
figure(1)
title('alpha=2.95')
subplot(2,2,1)
plot(z12,':rd')
axis([0 50 -1 1])
function f=f(a,x); f=a*x*(1-x); end
  댓글 수: 3
Byeongchan Min
Byeongchan Min 2020년 4월 26일
wow it worked thx!!! I think it'll take longer to understand it thoroughly though :D
Sriram Tadavarty
Sriram Tadavarty 2020년 4월 27일
Glad that it helped.
I will place the same in answer

답변 (1개)

Sriram Tadavarty
Sriram Tadavarty 2020년 4월 27일
Hi Byeongchan,
This observation is becuase the variable i and actual value in z11 and z12 are plotted. Since the effect values of z11 and z12 are a matrix of M x 2. Both the columns of them are plotted.
To have the proper plot, use the second colmn itself and it would provide expected results.
Try plot(z12(:,2), ':rd')
For more details, look at plot.
Hope this helps.
Thanking you.
Regards,
Sriram

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by