大家的问题请列举出来,课堂将重点阐述

课堂小测部分练习

课堂小测部分练习

梁绮旋3227010012 -
回帖数:0

vertcat

(1)

gradeofgroup1=[95 87 89;65 70 76; 88 90 92; 94 55 78]; gradeofgroup2=[86 89 75;85 65 77; 78 80 95; 93 75 88];
>> gradeofgroup=vertcat(gradeofgroup1,gradeofgroup2)

gradeofgroup =

95 87 89
65 70 76
88 90 92
94 55 78
86 89 75
85 65 77
78 80 95
93 75 88

(2)

sort( gradeofgroup,2,'descend')

ans =

95 89 87
76 70 65
92 90 88
94 78 55
89 86 75
85 77 65
95 80 78
93 88 75

(3)

max(gradeofgroup)

ans =

88 90 95

>> min(gradeofgroup)

ans =

55 70 76

gradeofgroup(:,1) = gradeofgroup(:,1) + 1;
gradeofgroup(:,3) = gradeofgroup(:,3) + 1;
>> disp(gradeofgroup)
96 87 90
79 80 96
89 90 93
95 55 79
87 89 76
86 65 78
66 70 77
94 75 89

降序排列还是不会请详细讲讲,还有循环和条件语句的编写也不懂