フィルターのクリア

dynamic system whose position coordinates are defined by this relationship

1 回表示 (過去 30 日間)
Kathrin Chari
Kathrin Chari 2019 年 11 月 13 日
コメント済み: Kathrin Chari 2019 年 11 月 14 日
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 Center および File ExchangeTime 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