sorting a matrix based on L2 norm of each row
    4 ビュー (過去 30 日間)
  
       古いコメントを表示
    
Hello all
Please how to code;  descendent sorting a matrix C(9000x9000) based on L2 norm of each row then reconstruct a new ranked matrix.
Thanks in advance
0 件のコメント
採用された回答
  Ameer Hamza
      
      
 2020 年 4 月 23 日
        
      編集済み: Ameer Hamza
      
      
 2020 年 4 月 23 日
  
      Try this
M = rand(9000); % random matrix for example
[~, idx] = sort(vecnorm(M, 2, 2), 'descend');
M_sorted = M(idx, :);
2 件のコメント
その他の回答 (1 件)
参考
カテゴリ
				Help Center および 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!


