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
댓글 수: 0
채택된 답변
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 Center 및 File 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!