0

Estoy haciendo este ciclo for de matlab a python Matlab:

for j=1:length(theta)
     th=theta(j);
     aa=[exp(-1j*(2-n)*pi*sin(th)) ]
     y(j)=w*aa; 

python:

for i in range(len(theta)):
th=theta[i]
aa=np.transpose([np.exp(-1j*(2-n)*np.pi*np.sin(th))])

Pero no sé como hacer la última línea en python, es decir: y(j)=w*aa; Gracias!

1 respuesta 1

0

Asumiendo que w es una constante, el código queda de la siguiente forma

for i in range(len(theta)):
th=theta[i]
aa=np.transpose([np.exp(-1j*(2-n)*np.pi*np.sin(th))])
y[i]=w*aa

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.