Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- مثال
- A = [ 4 2 1; 6 7 1; 1 5 9];
- A1 = sortrows(A);
- النتيجة :
- A1 =
- 1 5 9
- 4 2 1
- 6 7 1
- وإذا أردت ترتيب تنازلي لا تستعمل
- descend هكذا :
- A11 = sortrows(A,'descend');
- بل استعمل
- A11 = sortrows(A,-1);
- أو
- A11 = sortrows(A,1,'descend')
- وإذا أردت الترتيب حسب الصف الثاني أو الثالث تستعمل :
- A2 = sortrows(A,2);
- A3 = sortrows(A,3);
- ...
Advertisement
Add Comment
Please, Sign In to add comment