drawing a graph S(t)=sin(2​pift)+1/2s​in(6pift)

조회 수: 1 (최근 30일)
john malcovih dear sir
john malcovih dear sir 2011년 3월 1일
hi,thank u for all your helps,,could anybody help me with drawing S(t)=sin(2pift)+1/2sin(6pift) in matlab but each graph as individual like sin(2pift)as on gragh then 1/2sin(6pift) as theother graph and at the end S(t) that is sum of two graph .((assume that T=1 sec)) many many tanksssssssssssssssssssssssss

답변 (1개)

Eugeny Sosnovsky
Eugeny Sosnovsky 2011년 3월 1일
Assuming you want all 3 curves on a single plot:
f = 0.5; % Set f to whatever it's supposed to be here
S1 = @(t) sin(2*pi*f*t);
S2 = @(t) 1/2 * sin(6*pi*f*t);
S = @(t) S1(t) + S2(t);
T = linspace(0,1,1000);
plot(T,S1(T),T,S2(T),T,S(T));
legend({'S1(t)','S2(t)','S(t)'});
  댓글 수: 2
john malcovih dear sir
john malcovih dear sir 2011년 3월 1일
dearrrrrrrrrrrrrr,,,thanks a lot for your help but i want 3 curves on seperate plot....thankssssss again you are my heroo
David Young
David Young 2011년 3월 1일
Maybe better to avoid anonymous functions (quite hard because of the condensed syntax) in answers to beginners?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Directed Graphs에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by