# Plot issues

5 messages
Open this post in threaded view
|

## Plot issues

 Hi, all Sorry for a dummy question. I have some problems with the plot. I use this code . >> function xdot  =F(x,t)    D  =1.1;    r  = 0.0984;    ka =3;    z  =10;    umax=0.08;    km =3;    I0 =1;    xdot(1)= (-x.*(D)).+((umax.*((I0.*2.717.^(-ka.*x.*z))./((I0.*(2.717.^(-ka.*x*z))).+km))).*x) endfunction >> >> >> >> x0=9.8; >>  t= linspace(0,50,100); >>  quad("F",0,3); I’ve got the xdot result. But if I enter :plot(x,t) error: 'x' undefined near line 1 column 6 comes out. Can you tell me what the problem is ?? Best regards Tae hoon lee
Open this post in threaded view
|

## Re: Plot issues

 On Thu, Apr 16, 2020 at 6:06 PM 이태훈 <[hidden email]> wrote:Hi, all Sorry for a dummy question. I have some problems with the plot. I use this code . >> function xdot  =F(x,t)    D  =1.1;    r  = 0.0984;    ka =3;    z  =10;    umax=0.08;    km =3;    I0 =1;    xdot(1)= (-x.*(D)).+((umax.*((I0.*2.717.^(-ka.*x.*z))./((I0.*(2.717.^(-ka.*x*z))).+km))).*x) endfunction >> >> >> >> x0=9.8; >>  t= linspace(0,50,100); >>  quad("F",0,3); I’ve got the xdot result. But if I enter :plot(x,t) error: 'x' undefined near line 1 column 6 comes out. Can you tell me what the problem is ?? Best regards Tae hoon lee You never defined a variable named x. What should x be?Also, for what it's worth, the first input of the plot function is the independent variable, and the second is the dependent variable. I'm guessing you meant for t to be the independent variable.
Open this post in threaded view
|

## Re: Plot issues

 On Thu, Apr 16, 2020 at 7:31 PM 이태훈 <[hidden email]> wrote:Thanks,That’ right, my mistake. I want to see how the x changes over time. How should I define the x??? The x is the biomass, should I write the initial biomass value or make a function???Please use "Reply all" so the entire mailing list can help. Also, in this mailing list we respond below the previous message rather than above.Can you explain what it is you're trying to do? What is F? What variable are you trying to integrate it with respect to? I have no idea what biomass has to do with anything else.I'm not sure if it's what you were asking, but when you call the plot function, the arguments should be arrays with the same length. For example,n=100;x = linspace(0,2*pi,n);for j=1:ny(j) = x(j)*sin(x(j));endplot(x,y)