Asked by Sam
on 21 Mar 2014

I am getting this error msg. Please find me the mistakes here.

In an assignment A(I) = B, the number of elements in B and I must be the same.

r=[2.0 3.1 3.5 3.65 3.84 3.95];

x=[];

x(1)=0.35;

f=@(x) r*x*(1-x);

N=40;

for t=1:N-1;

x(t+1)=f(x(t));

end

hold on

plot(x,'r-')

*No products are associated with this question.*

Answer by Joseph Cheng
on 21 Mar 2014

yes thats because you are including information that is not here and in your other posting that was flagged. but looks like you have it so we're all set?

Joseph Cheng
on 21 Mar 2014

Star Strider
on 21 Mar 2014

And it’s *not* cheating to have MATLAB Answers do your homework for you?

Answer by Joseph Cheng
on 21 Mar 2014

Edited by Joseph Cheng
on 21 Mar 2014

Were you attempting to do this?

r=[2.0 3.1 3.5 3.65 3.84 3.95]; x=[]; x(1,:)=0.35*ones(size(r)); f=@(x) r*x*(1-x); N=40; for t=1:N-1; x(t+1,:)=f(x(t)); end hold on plot(x) legend('r = 2.0','r = 3.1', 'r = 3.65')

Where the first value of x is 0.35? or you can re-write it such that the function

f=@(x,r) r*x*(1-x);

such that you write a for loop to cycle in the r you need.

Show 5 older comments

Joseph Cheng
on 21 Mar 2014

Joseph Cheng
on 21 Mar 2014

no it doesn't make sense. how do they look different? shape? amplitude?

Opportunities for recent engineering grads.

## 0 Comments