Matrix Division: Getting all 1s for my end result

3 ビュー (過去 30 日間)
Guan Zhao
Guan Zhao 2012 年 10 月 12 日
Hey guys,
I am trying to do a matrix division by using the A./B function for a 2 large identical sized matrix. However, the end result is a same sized matrix with all 1s, despite both matrix A and matrix A having different values.
I tried creating a 2 small matrix to try out the division, and it works. But it doesn't work for my actual matrix.
Can anyone tell me what is going on?
Regards
Guan Zhao
  5 件のコメント
Guan Zhao
Guan Zhao 2012 年 10 月 12 日
編集済み: Guan Zhao 2012 年 10 月 12 日
Name Size Bytes Class Attributes
B 456x744 339264 uint8
A 456x744 339264 uint8
Matt J
Matt J 2012 年 10 月 12 日
編集済み: Matt J 2012 年 10 月 12 日
See my answer below. You need to convert A and B to floating point type (they are currently integer type uint8) in order to do floating point math with them.

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

採用された回答

Matt J
Matt J 2012 年 10 月 12 日
See if this makes a difference
double(A)./double(B)
  1 件のコメント
Guan Zhao
Guan Zhao 2012 年 10 月 12 日
THANK YOU SO MUCH!

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by