how do I write this function on matlab ?

Respuestas (1)

Jan
Jan el 13 de En. de 2018
Editada: Jan el 13 de En. de 2018
v = sqrt(v_x ^ 2 + v_y ^ 2) % [EDITED] Typo fixed
theta = atan(v_x / v_y)
Looks like a straight forward conversion.
Maybe v_x and v_y are arrays. Then use the elementwise operations:
v = sqrt(v_x .^ 2 + v_y .^ 2)
theta = atan(v_x ./ v_y)

3 comentarios

Jan
Jan el 13 de En. de 2018
@Image Analyst: Thanks. From time to time I dare to fix obvious typos in the messages of others.
Image Analyst
Image Analyst el 13 de En. de 2018
In the future I could, if you'd agree.
Jan
Jan el 13 de En. de 2018
Image Analyst, I agree. I appreciate your support.

Iniciar sesión para comentar.

Categorías

Etiquetas

Preguntada:

el 13 de En. de 2018

Comentada:

Jan
el 13 de En. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by