Divide higher to lower value column wise in matrix
이전 댓글 표시
Could you please help me to find a way of how to divide values in 2*n matrix column wise so that i divide higher to lower number in every row. Thank you for any help!
답변 (1개)
Image Analyst
2014년 8월 31일
Try this:
m=rand(2, 10) % Sample data.
% Sort to put the biggest number in the top row.
m_sorted = sort(m, 1, 'descend')
% Do the division.
ratios = m_sorted(1,:) ./ m_sorted(2,:)
카테고리
도움말 센터 및 File Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!