could anyone help me to overcome the error in following code:
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
code:
A = 1:10;
B = maxk(A,3)
function
function y=maxk(A,3)
A=sort(unique(A,'descend'))
y=A(1:3)
end
1 commentaire
madhan ravi
le 28 Mar 2019
Stop asking the same thing again and again!! https://in.mathworks.com/matlabcentral/answers/452997-could-anyone-help-me-to-overcome-the-error-in-the-following-code#comment_686944
Réponses (1)
KSSV
le 28 Mar 2019
Modifié(e) : KSSV
le 28 Mar 2019
Read about unique and sort. The term descend should be for sort.
function y=maxk(A,3)
A=sort(unique(A),'descend')
y=A(1:3)
end
1 commentaire
madhan ravi
le 28 Mar 2019
KSSV the OP asks the same question again and again , why did you reopen the closed question ignoring the comment?
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!