Borrar filtros
Borrar filtros

Divide higher to lower value column wise in matrix

1 visualización (últimos 30 días)
Olga
Olga el 31 de Ag. de 2014
Comentada: Olga el 31 de Ag. de 2014
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!

Respuestas (1)

Image Analyst
Image Analyst el 31 de Ag. de 2014
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,:)

Categorías

Más información sobre Shifting and Sorting Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by