how to converter negative integers to postive and then get back to negative
조회 수: 5 (최근 30일)
이전 댓글 표시
rgb_image =(imread('baboon.tiff','tiff'));
LS = liftwave('cdf2.2','Int2Int');
[CA,CH,CV,CD] = lwt2(double(rgb_image),LS);
in CA,CH,CV,CD am getting negtive integers i want to convert negative to positive integers
then again positive to negative as original CA,CH,CV,CD and get back the baboon image
- i thought of doing one's compliment but unable to itcan any help help
댓글 수: 0
답변 (1개)
KSSV
2018년 9월 27일
K = [-2 2 ; 2 -4] ;
% negative to positive
idx = K<0 ;
K(idx) = -K(idx) ;
% Agin to negative
K(idx) = -K(idx) ;
댓글 수: 2
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!