L = randint(5,6,[1 20])
j = 3;
a = L(:,j);
LL = (a>=10) & (a<=20); % 先处理增大的值,不然要影响小于的判断
a(LL) = a(LL)*5;
LL = a<10;
a(LL) = a(LL)*2;
L(:,j) = a;
a
L
L =
18 2 2 2 20 9
13 11 11 17 3 9
16 11 17 3 1 8
9 6 3 18 8 19
20 8 4 11 9 14
a =
4
55
85
6
8
L =
18 2 4 2 20 9
13 11 55 17 3 9
16 11 85 3 1 8
9 6 6 18 8 19
20 8 8 11 9 14