How to draw lots with matlab? That is to say, two out of six students? I've done it before, but it only shows my last name, not my last name. thank you

I think your question may be for help, but I'll answer it. You can refer to the following:

Firstnameset={' Qian',' Zhang',' Li',' Wang',' Zhao',' Wu'};

Secondnameset={' two',' three',' four',' five',' six',' pockmarked'};

temp = rand perm(6);

Disp ('lottery result:');

person 1 =[cell 2 mat(first name set(temp( 1))),cell 2 mat(second name set(temp( 1))];

person 2 =[cell 2 mat(first name set(temp(2))),cell 2 mat(second name set(temp(2)))];

disp(person 1);

Disp (personnel 2);

You can see the result after running a lap ~