I want to generate Three different random Communication Channels and sort it. Please help
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
PRADEEP KUMAR
le 30 Juil 2021
Commenté : PRADEEP KUMAR
le 30 Juil 2021
h1=(randn(1)+1j*randn(1));
h2=(randn(1)+1j*randn(1));
h3=(randn(1)+1j*randn(1));
z=sort(h1,h2,h3)
Error using sort
Dimension argument must be a positive integer.
0 commentaires
Réponse acceptée
Walter Roberson
le 30 Juil 2021
h1=(randn(1)+1j*randn(1));
h2=(randn(1)+1j*randn(1));
h3=(randn(1)+1j*randn(1));
z=sort([h1,h2,h3])
Note that by default, sort() operates along the first non-scalar dimension, so if you were to use vectors you would have to be careful about how you sorted.
h1=(randn(5,1)+1j*randn(5,1));
h2=(randn(5,1)+1j*randn(5,1));
h3=(randn(5,1)+1j*randn(5,1));
z=sort([h1,h2,h3], 2) %sort along rows
However... you need to be clearer as to what it means to you to sort complex data. MATLAB has a meaning for sorting complex data, but it is not likely that MATLAB's meaning is the same as what you want.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Shifting and Sorting Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!