How can plot integral for sin wave

HELLO
iam plot sin wave signal and used the code in m file:
t=0:0.1:360*22/7/180;
x1=sin(t);
plot(t,x1);
but how can plot integral for sin wave?
please help me
tech

댓글 수: 4

Azzi Abdelmalek
Azzi Abdelmalek 2013년 6월 14일
Can you be more specific? Definite or indefinite integral?
face wasd
face wasd 2013년 6월 14일
thanks Azzi Abdelmalek for reply
the integral from 0 to 360
Wayne King
Wayne King 2013년 6월 14일
Now, I'm confused. You say "how can plot integral for sin wave?" This has to be the indefinite integral. The definite integral is just a number, so do you want to plot something or do you just want a number. Did you see my response below? That finds and plots the indefinite integral.
face wasd
face wasd 2013년 6월 14일
Iam plot integral for sin wave in simulink ,the form the signal positive and the amplitude from 0 to 2 ????

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

답변 (3개)

dileep- adabala
dileep- adabala 2013년 6월 14일

0 개 추천

DO MATHEMATICAL CALCULATIONS FIRST TTHEN PLOT FOR COS WAVE
Wayne King
Wayne King 2013년 6월 14일
편집: Wayne King 2013년 6월 14일

0 개 추천

t=0:0.1:360*22/7/180;
x1=sin(t);
dt = t(2)-t(1);
x2 = cumsum(x1.*dt);
x2 = x2-1-x2(1);
plot(t,x2)
Or
x2 = cumtrapz(t,x1);
x2 = x2-1-x2(1);
plot(t,x2)

댓글 수: 2

face wasd
face wasd 2013년 6월 14일
thanks for reply
Iam plot integral for sin wave in simulink ,the form the signal positive and the amplitude from 0 to 2 ????
sirisha tammineni
sirisha tammineni 2021년 2월 23일
x2 = cumsum(x1.*dt);
x2 = x2-1-x2(1); sir can u explain these two lines

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

Samarth
Samarth 2013년 6월 14일

0 개 추천

f=inline('sinx','x');
syms x;
y=int(f(x),x);
t=0:0.1:360*22/7/180
hold on
plot(y(t),t);
end

카테고리

도움말 센터File Exchange에서 Simulink에 대해 자세히 알아보기

제품

태그

질문:

2013년 6월 14일

댓글:

2021년 2월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by