Magnitude of difference from one vector (number) to another

3 visualizaciones (últimos 30 días)
Jasvir Bahl
Jasvir Bahl el 28 de Abr. de 2017
Comentada: KSSV el 28 de Abr. de 2017
Hi,
I have defined two vectors: X = -135.89 Y = -84.96066717
I want to determine how far away Y is compared to X (i.e. the return answer should be close to 50).
Can someone please help?
  1 comentario
KSSV
KSSV el 28 de Abr. de 2017
Your X and Y are not vectors, they are scalars. You can get what you want using:
d = abs(abs(X)-abs(Y))

Iniciar sesión para comentar.

Respuestas (0)

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by