MATLAB: How can i do this

graph

i must plot a graph like this:
(there are many functions that are valid for difference particular time in a period, for example for td interval function 1 is valid, for tr interval function 2 is valid…)
a code like this is okey:
x=0:0.1:1;
a=x.^2;
y=1:0.1:2;
b=y.^3;
z=2:0.1:3;
c=z.^3;
plot(x,a,y,b,z,c);
but i have to plot these functions, there is a mistake, would you help me please ?
k=0:10.^-12:6.9*10.^-9;
a=25*10.^-6*80;
l=6.9*10.^-9:10.^-12:2.29*10.^-8;
b=25*10.^-6*l./(16*10.^-9)*(80+(2.16-80)*l./(16*10.^-9));
m=2.29*10.^-8:10.^-12:2.5*10.^-6;
c=4*2.16;
n=2.5*10.^-6:10.^-12:2.515*10.^-6;
d=4*2.16;
o=2.515*10.^-6:10.^-12:2.5244*10.^-6;
e=80*4*((1-o./(9.4*10.^-9))*o./(9.4*10.^-9));
p=2.5244*10.^-6:10.^-12:5*10.^-6;
f=25*10.^-6*80;
plot(k,a,l,b,m,c,n,d,o,e,p,f);
??? Error using ==> mtimes
Inner matrix dimensions must agree.

Best Answer

On the lines where you calculate b, and e, you probably want to use the element-wise multiplication .* instead of the matrix multiplication * between your two halves. For example:
b=25*10.^-6*l./(16*10.^-9).*(80+(2.16-80)*l./(16*10.^-9));
Also, I think you will want c,d, and f to be arrays, not scalars. For example:
c=4*2.16*ones(size(m));