Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

check where is my error of command...

Status
Not open for further replies.

awanis

Junior Member level 1
Joined
Sep 15, 2009
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
malaysia
Activity points
1,387
can anybody cek my command matlab..
i want to plot X(t) signal..

ts= 0.0313
y=linspace(0,4*pi,200);
x1=6*sin(3*pi*ts);
figure(4);
plot(y,x1,'r')
hold on
x2=[5*cos(6*pi*ts)];
plot(y,x2,'g')
x3=[7*cos(8*pi*ts+(0.167*pi))];
plot(y,x3,'-')
hold off

the error is at plot(y,x1,'r')..
what should i do with the command..
 

Aya2002

Advanced Member level 4
Joined
Dec 12, 2006
Messages
1,142
Helped
184
Reputation
376
Reaction score
118
Trophy points
1,343
Location
Iraq
Activity points
8,019
your ts must be a vector such as
ts=0:0.0313/100:0.0313;

try this
 

awanis

Junior Member level 1
Joined
Sep 15, 2009
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
malaysia
Activity points
1,387
its true the graph should be like this..


X(t) signal
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top