Borrar filtros
Borrar filtros

How can plot integral for sin wave

1 visualización (últimos 30 días)
face wasd
face wasd el 14 de Jun. de 2013
Comentada: sirisha tammineni el 23 de Feb. de 2021
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 comentarios
Wayne King
Wayne King el 14 de Jun. de 2013
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 el 14 de Jun. de 2013
Iam plot integral for sin wave in simulink ,the form the signal positive and the amplitude from 0 to 2 ????

Iniciar sesión para comentar.

Respuestas (3)

dileep- adabala
dileep- adabala el 14 de Jun. de 2013
DO MATHEMATICAL CALCULATIONS FIRST TTHEN PLOT FOR COS WAVE

Wayne King
Wayne King el 14 de Jun. de 2013
Editada: Wayne King el 14 de Jun. de 2013
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 comentarios
face wasd
face wasd el 14 de Jun. de 2013
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 el 23 de Feb. de 2021
x2 = cumsum(x1.*dt);
x2 = x2-1-x2(1); sir can u explain these two lines

Iniciar sesión para comentar.


Samarth
Samarth el 14 de Jun. de 2013
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

Categorías

Más información sobre Spectral Measurements en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by