이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
I have 2 matrices
A ranges between -32768 to 32767 ,it is 100x1 matrix
class(A) is int16
B matrix ranges from -1473 to 1570,it is 100x1 matrix
class(B) is double
asuming i divide manually the values ,max(B)/max(A), i get correct answer , but while runnning in m file , the value exceeds
The maximum value must be .049 ,but i get 1.73,
I converted both A and B to double,still i get same error ,
please assist
채택된 답변
Walter Roberson
2012년 11월 26일
0 개 추천
What happens if you break it up and display the values:
ma = max(A)
class(ma)
size(ma)
mb = max(B)
class(mb)
size(mb)
mb / ma
mb ./ ma
댓글 수: 9
Pat
2012년 11월 26일
class of ma is int16
class of B is double
size same for A,B-100x1
max(A) is 32767,B is 1540
mb/ma-
??? Error using ==> mrdivide
Linear algebra is not supported for
integer data types.
mb./ma
??? Error using ==> rdivide
Class of operand is not supported.
After converting to double
double(max(B))./double(max(A))
ans =
0.0470
Walter Roberson
2012년 11월 26일
So the problem has gone away?
Pat
2012년 11월 26일
it is manula calculation in command window,but if i perform in m file i get error
Walter Roberson
2012년 11월 26일
편집: Walter Roberson
2012년 11월 26일
What happens if you paste the commands into the .m file right after your current calculation ?
ma = max(A)
class(ma)
size(ma)
mb = max(B)
class(mb)
size(mb)
double(mb) ./ double(ma)
and what is the exact line you are using for calculation at the moment?
Pat
2012년 11월 26일
same answer
0.0470
Walter i mean if i divide the max values ,the value is 0.04,y do i get larger values than that ,while dividing others
Walter Roberson
2012년 11월 26일
편집: Walter Roberson
2012년 11월 26일
I don't know: you do not show the other values you are dividing.
If you are dividing elements of A and B pairwise, then the maximum possible result is reached if max(B(B>0)) is at the same location as min(A(A>=0)), or if min(B(B<0)) is at the same location as min(A(A<0)); and the maximum can be infinite because 0 is a valid member of A; NaN is also a possible output if a 0 in B happens to be at the same location as a 0 in A.
Pat
2012년 11월 26일
Walter suppose am dividing a 14bit value/16 bit value,will i get 5 bit value or larger than that
Walter Roberson
2012년 11월 26일
Any non-zero value divided by 0 gives an infinite result, which is going to be more than 5 bits.
If you have a 14 bit value divided by 1 (which is a valid 16 bit value) then you are going to get a 14 bit value output.
Any 14 bit value divided by a value that could be represented (without compression) in 8 or fewer binary digits, is going to give a result that requires more than 5 bits.
64 (7 bits) / 2 (2 bits) = 32 (6 bits) so the numbers represented as 14 bits can be pretty small and you would still have problems.
Pat
2012년 11월 26일
Thanks walter
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
태그
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
