Azzera filtri
Azzera filtri

could anyone help me to overcome the error in following code:

1 visualizzazione (ultimi 30 giorni)
code:
A = 1:10;
B = maxk(A,3)
function
function y=maxk(A,3)
A=sort(unique(A,'descend'))
y=A(1:3)
end

Risposte (1)

KSSV
KSSV il 28 Mar 2019
Modificato: KSSV il 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 Commento
madhan ravi
madhan ravi il 28 Mar 2019
KSSV the OP asks the same question again and again , why did you reopen the closed question ignoring the comment?

Accedi per commentare.

Categorie

Scopri di più su Shifting and Sorting Matrices in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by