Question: I am having some trouble with my Matlab code and I'm confused now

My assignment is to plot 3 graphs when u0=65.70 and 95 and I thought I did my code properly but now I am getting weird errors

 

a0:=80;
a1:=-5;
b1:=-5*(3)^0.5;
w:=Pi/12;
k:=0.2;
u0:=65;

t=0:0.001:100;
c0=u0-a0-(k^2*a1-k*w*b1)/(k^2+w^2);
c1=(k^2*a1-k*w*b1)/(k^2+w^2);
d1=(k*w*a1+k^2*b1)/(k^2+w^2);
u=a0+c0*exp(-k*t)+c1*cos(w*t)+d1*sin(w*t);
plot(t,u,'r');

I am getting an error here that says Error, (in plot) unexpected options: [65., r] and I don't know how to fix this


legend('u(0)=65');


hold on;
u0=70;
c0=u0-a0-(k^2*a1-k*w*b1)/(k^2+w^2);
c1=(k^2*a1-k*w*b1)/(k^2+w^2);
d1=(k*w*a1+k^2*b1)/(k^2+w^2);
u=a0+c0*exp(-k*t)+c1*cos(w*t)+d1*sin(w*t);
plot(t,u,'-');

I am also getting an error with the '-' portion of my plot "Error, invalid uneval"

legend('u(0)=70');


hold on;
u0=95;
c0=u0-a0-(k^2*a1-k*w*b1)/(k^2+w^2);
c1=(k^2*a1-k*w*b1)/(k^2+w^2);
d1=(k*w*a1+k^2*b1)/(k^2+w^2);
u=a0+c0*exp(-k*t)+c1*cos(w*t)+d1*sin(w*t);
plot(t,u,'g');

I am getting an error yet again with my plot and this time it is "Warning, expecting only range variable u in expression t to be plotted but found name t"


legend('u(0)=90');

Please Wait...