>> mat1=rand(10,8)
mat1 =
0.2599 0.5499 0.1839 0.3692 0.5752 0.6477 0.7802 0.8176
0.8001 0.1450 0.2400 0.1112 0.0598 0.4509 0.0811 0.7948
0.4314 0.8530 0.4173 0.7803 0.2348 0.5470 0.9294 0.6443
0.9106 0.6221 0.0497 0.3897 0.3532 0.2963 0.7757 0.3786
0.1818 0.3510 0.9027 0.2417 0.8212 0.7447 0.4868 0.8116
0.2638 0.5132 0.9448 0.4039 0.0154 0.1890 0.4359 0.5328
0.1455 0.4018 0.4909 0.0965 0.0430 0.6868 0.4468 0.3507
0.1361 0.0760 0.4893 0.1320 0.1690 0.1835 0.3063 0.9390
0.8693 0.2399 0.3377 0.9421 0.6491 0.3685 0.5085 0.8759
0.5797 0.1233 0.9001 0.9561 0.7317 0.6256 0.5108 0.5502
>> sort_mat=sort(mat1)
sort_mat =
0.1361 0.0760 0.0497 0.0965 0.0154 0.1835 0.0811 0.3507
0.1455 0.1233 0.1839 0.1112 0.0430 0.1890 0.3063 0.3786
0.1818 0.1450 0.2400 0.1320 0.0598 0.2963 0.4359 0.5328
0.2599 0.2399 0.3377 0.2417 0.1690 0.3685 0.4468 0.5502
0.2638 0.3510 0.4173 0.3692 0.2348 0.4509 0.4868 0.6443
0.4314 0.4018 0.4893 0.3897 0.3532 0.5470 0.5085 0.7948
0.5797 0.5132 0.4909 0.4039 0.5752 0.6256 0.5108 0.8116
0.8001 0.5499 0.9001 0.7803 0.6491 0.6477 0.7757 0.8176
0.8693 0.6221 0.9027 0.9421 0.7317 0.6868 0.7802 0.8759
0.9106 0.8530 0.9448 0.9561 0.8212 0.7447 0.9294 0.9390
>> resul1=sort_mat(7:10,:)
resul1 =
0.5797 0.5132 0.4909 0.4039 0.5752 0.6256 0.5108 0.8116
0.8001 0.5499 0.9001 0.7803 0.6491 0.6477 0.7757 0.8176
0.8693 0.6221 0.9027 0.9421 0.7317 0.6868 0.7802 0.8759
0.9106 0.8530 0.9448 0.9561 0.8212 0.7447 0.9294 0.9390
>>
Best Answer