I am getting a parse error on the = sign in the third line but i cant seem to figure out why. Any suggestions and or solutions? Thanks

조회 수: 1 (최근 30일)
N = 1000;
r = .5;
x.*(i+1) = r.*x.(i).*(1-x)
x = zeros(1,N);
x(1) = rand(1);
for i=1:N-1
x(i+1) = r.*x(i).*(1-x(i));
end
plot(x);

채택된 답변

KSSV
KSSV 2017년 9월 27일
The line where errors pops is unnecessary.
N = 1000;
r = .5;
% x(i+1) = r.*x.(i).*(1-x)
x = zeros(1,N);
x(1) = rand(1);
for i=1:N-1
x(i+1) = r.*x(i).*(1-x(i));
end
plot(x);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Entering Commands에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by