필터 지우기
필터 지우기

dynamic system whose position coordinates are defined by this relationship

조회 수: 1 (최근 30일)
dynamic system whose position coordinates are defined by relationship:
x(k+1)= 1 + y(k) - 1.4*x(k)^2
y(k+1)= 0.3*x(k)
function [x y] = MEMS_chaos (k)
x(0)=y(0)=0;
for i = 0:k
x(i+1) = 1 + y(i)-1.4*x(i)^2
y(i+1) = 0.3*x(i)
[x,y]
end
end
.....I tried this but it's vain...i cant find the errors

채택된 답변

Walter Roberson
Walter Roberson 2019년 11월 13일
MATLAB never permits indexing at 0. You will need to add 1 to all of your indices. x(0+1) and so on.
Also, MATLAB does not permit transitive assignment. You will need to create two assignment statements.
x(0+1) = 0;
y(0+1) = 0;
for i = 0:k
x(i+1+1) = 1 + y(i+1)-1.4*x(i+1)^2
y(i+1+1) = 0.3*x(i+1)
[x,y]
end
You should ask yourself whether displaying the ever-longer x and y vectors is part of the question, or if you are just intended to return them.
You should also carefully consider how many items long the output vectors are intended to be. for i=0:k does k+1 steps . Are the initial positions (0,0) to be part of the output vectors? If so then is the expected length k exactly, or k+1, or k+2 ?

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Time and Frequency Domain Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by