Magnitude of difference from one vector (number) to another

2 ビュー (過去 30 日間)
Jasvir Bahl
Jasvir Bahl 2017 年 4 月 28 日
コメント済み: KSSV 2017 年 4 月 28 日
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 件のコメント
KSSV
KSSV 2017 年 4 月 28 日
Your X and Y are not vectors, they are scalars. You can get what you want using:
d = abs(abs(X)-abs(Y))

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeFinancial Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by