MATLAB: Hi, i want to plot simple function, Can someone tell me how to plot it

graphodephase plotphase portraitplotplotting

y1 = c1*exp(-6*t)+c2*t*exp(-6*t);
y2 = -c1*exp(-6*t)+c2*(exp(-6*t)*(-t-0.5));
where c1 and c2 are arbitary values and t is time. I want to plot y1 vs y2 for different values of c1,c2

Best Answer

t=0.001:0.001:1; % define t as you want
c1=rand;
c2=rand;
y1 = c1*exp(-6*t)+c2*t.*exp(-6*t);
y2 = -c1*exp(-6*t)+c2*(exp(-6*t).*(-t-0.5));
plot(t,y1)
hold on; % if you want to plot on the same graph
plot(t,y2)
Related Question