필터 지우기
필터 지우기

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)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by