Schahan
Electrical
- Apr 27, 2006
- 4
Hello
My program plots 1xtime triagle
but i just want that it plots 2xtime (with repmat)
How can i do it?
thx
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
A = 3
f = 200
tend = 0.01
t = round (tend)
N0 = 10
fs = N0*f
N = round(tend*fs)
t1 = 0:0.005:N0/4
t2 = (N0/4):0.005
3/4)*N0
t3 = ((3/4)*N0):0.005:N0
y1 = 4*A/N0*t1
y2 = -4*A/N0*t2 + 2*A
y3 = (4*A/N0)*t3 - 4*A
t = [t1 t2 t3];
y = [y1 y2 y3];
plot(t,y,'LineWidth',2)
axis([0 N -4 4])
set(gca,'XTick',[(0:9)*N/10])
set(gca,'XTicklabel',[0:9])
set(gca,'YTick',[-4 -3 -2 -1 0 1 2 3 4])
grid on
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
My program plots 1xtime triagle
but i just want that it plots 2xtime (with repmat)
How can i do it?
thx
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
A = 3
f = 200
tend = 0.01
t = round (tend)
N0 = 10
fs = N0*f
N = round(tend*fs)
t1 = 0:0.005:N0/4
t2 = (N0/4):0.005
t3 = ((3/4)*N0):0.005:N0
y1 = 4*A/N0*t1
y2 = -4*A/N0*t2 + 2*A
y3 = (4*A/N0)*t3 - 4*A
t = [t1 t2 t3];
y = [y1 y2 y3];
plot(t,y,'LineWidth',2)
axis([0 N -4 4])
set(gca,'XTick',[(0:9)*N/10])
set(gca,'XTicklabel',[0:9])
set(gca,'YTick',[-4 -3 -2 -1 0 1 2 3 4])
grid on
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%