I created a code for a random amount of people to get into the elevator and an exact same random of floors selected but I am having trouble setting up the ascending part. I tried to do the for/end function to automatically go but it came to an error, can someone help please.
a = nonzeros(round(10*rand(1,1)))
e(1).floor='lobby';
e(2).floor='firstfloor';
e(3).floor='secondfloor';
e(4).floor='thirdfloor';
e(5).floor='fourthfloor';
e(6).floor='fifthfloor';
e(7).floor='sixthfloor';
e(8).floor='seventhfloor';
e(9).floor='eightfloor';
e(10).floor='ninethfloor';
n = round(9*rand(1,a))
o = n
for o = [1:10]
x(o) = n*1;
end