matlab stuff.
@Nnesha I'll grab the code in a bit... I need to get it first :P
hmm would it be better to post in computer science?
what D:!
?/???///
no. matlab has the word has the word math in it :P
hmmm
yessssssssss....moving on...
matlab related to computers http://openstudy.com/study#/groups/Computer%20Science
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
i dotn have matlab
@dan815 is here! THANK GAWD! I need help on this particular code!
@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
matlab is short for matrix laboratory, not math laboratory
sorry but I still have no idea why the example code (the ditera2) isn't working right. I have an error line 9 issue
Aha, math lab.
in drickerz, you appear to be calling the function `dricker`, inside of itself, which sets up an infinite loop
huh?
infinite loop?
well the exercise said to change it to dricker for that equation
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?
@Kainui we're stuck in code matlab land >_<
if I don't have that ; at each line, then the result just won't show up
% 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?
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
so i = 2 for this to work?
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
year
eww my graph looks flat!
what is it meant to look like?
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
moreover why the heck am I given 2 graphs on the fourth example?
I got this to work. That code and a dlogplt code should be in unison ....and I misunderstood the tutorial page, but yeahhh!
@ganeshie8 look at my diagrams!
Join our real-time social learning platform and learn together with your friends!