Ask your own question, for FREE!
Mathematics 20 Online
OpenStudy (usukidoll):

matlab stuff.

OpenStudy (usukidoll):

@Nnesha I'll grab the code in a bit... I need to get it first :P

OpenStudy (alexandervonhumboldt2):

hmm would it be better to post in computer science?

OpenStudy (usukidoll):

what D:!

OpenStudy (alexandervonhumboldt2):

?/???///

OpenStudy (usukidoll):

no. matlab has the word has the word math in it :P

OpenStudy (alexandervonhumboldt2):

hmmm

OpenStudy (usukidoll):

yessssssssss....moving on...

OpenStudy (alexandervonhumboldt2):

matlab related to computers http://openstudy.com/study#/groups/Computer%20Science

OpenStudy (usukidoll):

It has something to do with a ricker model ugh... anyway I got the first two codes to work, but when I tried the example for the third code the ditera2, I have an error on line 9

OpenStudy (alexandervonhumboldt2):

i dotn have matlab

OpenStudy (usukidoll):

@dan815 is here! THANK GAWD! I need help on this particular code!

OpenStudy (usukidoll):

@dan815 matlabsessioncodes is the example drickerz is the two codes that I already have for the previous two examples. The third one in matlabsessioncodes is driving me nuts because it produces an error line 9 and I've typed it correctly ... even copypasta'd and still won't work. I have no idea what is going on

OpenStudy (unklerhaukus):

matlab is short for matrix laboratory, not math laboratory

OpenStudy (usukidoll):

sorry but I still have no idea why the example code (the ditera2) isn't working right. I have an error line 9 issue

OpenStudy (jhannybean):

Aha, math lab.

OpenStudy (unklerhaukus):

in drickerz, you appear to be calling the function `dricker`, inside of itself, which sets up an infinite loop

OpenStudy (usukidoll):

huh?

OpenStudy (usukidoll):

infinite loop?

OpenStudy (usukidoll):

well the exercise said to change it to dricker for that equation

OpenStudy (usukidoll):

function [f, fprime] = dricker(x,b) f=b.*x.*exp(-x); if nargout>1 fprime =-b.*x.*exp(-x)+b.*exp(-x); end should be it for the first one right?

OpenStudy (usukidoll):

@Kainui we're stuck in code matlab land >_<

OpenStudy (usukidoll):

if I don't have that ; at each line, then the result just won't show up

OpenStudy (usukidoll):

% Computes iterates and stores data for cobweb plot function [x,web1,web2]=diter2(x0,r,n) %DITER2 Computes iterates of the discrete logistic function % x=zeros(n+1,1); web1=zeros(202,1); web2=zeros(202,1); x(1,1)=x0; j=1; for i=1:n xi=x(i,1); if i>=n-100 web1(j)=x(i-1,1); web2(j)=x(i,1); web1(j+1)=x(i,1); web2(j+1)=x(i,1); j=j+2; end x(i+1,1)=dlogistic(xi,r); end is driving me nuts. Why isn't that part of the code working?

OpenStudy (unklerhaukus):

when `i=1`, `i-1` = 0, so `x(i-1, 1)` is x(0, 1) matlab starts indexing from one, not zero, so x(0,1) is undefined

OpenStudy (usukidoll):

so i = 2 for this to work?

OpenStudy (usukidoll):

ahahahaah I made i=2 and it worked so let's see i = 2 2-1 =1 x(i-1,1) is x(1,1) @UnkleRhaukus

OpenStudy (unklerhaukus):

year

OpenStudy (usukidoll):

eww my graph looks flat!

OpenStudy (unklerhaukus):

what is it meant to look like?

OpenStudy (usukidoll):

I'm not sure.. the example says % Computes iterates and stores data for cobweb plot function [x,web1,web2]=diter2(x0,r,n) %DITER2 Computes iterates of the discrete logistic function % x=zeros(n+1,1); web1=zeros(202,1); web2=zeros(202,1); x(1,1)=x0; j=1; for i=1:n xi=x(i,1); if i>=n-100 web1(j)=x(i-1,1); web2(j)=x(i,1); web1(j+1)=x(i,1); web2(j+1)=x(i,1); j=j+2; end x(i+1,1)=dlogistic(xi,r); end but I wasn't given a picture

OpenStudy (usukidoll):

moreover why the heck am I given 2 graphs on the fourth example?

OpenStudy (usukidoll):

I got this to work. That code and a dlogplt code should be in unison ....and I misunderstood the tutorial page, but yeahhh!

OpenStudy (usukidoll):

OpenStudy (usukidoll):

OpenStudy (usukidoll):

@ganeshie8 look at my diagrams!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!