MATLAB Answers

how to evaluate equation at different values?

3 views (last 30 days)
Omar B.
Omar B. on 20 Sep 2021
Edited: Omar B. on 21 Sep 2021
I'd like to find and save x at different values of mu.
Itried to write mu=linspace (2.4,4,1000) but I did not know how to complete the code.
Can you please help me.
mu=linspace(2.4,4,1000);
x(1)=.5;
for i=1:10
x(i+1)=mu*x(i)*(1-x(i));
end

Answers (1)

KSSV
KSSV on 20 Sep 2021
mu=linspace(2.4,4,1000);
x = zeros(size(mu)) ;
x(1)=.5;
for i=1:10
x(i+1)=mu(i)*x(i)*(1-x(i));
end
plot(mu,x)
  5 Comments

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!