Borrar filtros
Borrar filtros

Can someone help me writing this equation in matlab, I appreciate,..

4 visualizaciones (últimos 30 días)

Respuesta aceptada

Jon
Jon el 12 de En. de 2022
Here is an example where I have supplied some arbitrary values for P,N, phi and omega. You can modify with the values you actually want to use
P = 5
N = 2
phi = pi/3
omega = pi/4
t = linspace(0,20); %put your final time here
i = complex(0,1)
z = P*exp(i*phi)*exp(i*omega*t) + N*exp(i*phi)*exp(-i*omega*t)
  1 comentario
Jon
Jon el 12 de En. de 2022
You can also use 1i to represent a complex value and do it like this
P = 5
N = 2
phi = pi/3
omega = pi/4
t = linspace(0,20); %put your final time here
z = P*exp(1i*phi)*exp(1i*omega*t) + N*exp(1i*phi)*exp(-1i*omega*t)

Iniciar sesión para comentar.

Más respuestas (1)

Cris LaPierre
Cris LaPierre el 12 de En. de 2022
Writing the equation is rather straightforward. You just need to decide what variable names you want to use. Here's one way.
z = P*exp(phi*1i)*exp(w*t*1i) + N*exp(phi*1i)*exp(-w*t*1i)
I suggest going through MATLAB Onramp will enable you to not only write the equation yourself, but actually use it to calculate values for z.

Categorías

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

Etiquetas

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by