Assign studentName with the string element at seatPosition i

Assign studentName with the string element at seatPosition in array classRoster. function studentName = Student Lookup (classRoster, seat Position) studentName = \'FIXME\'; end Code to call your function when you click Run StudentLookup([\'Megan\'; \'Greg\'; \'Jacob\'; \'Tony\'], 3) Check if StudentLookup([\'Megan\'; \'Greg\'; \'Jacob\'; \'Tony\';], 3) returns Jacob Check if StudentLookup([\'Arlannal\'; \'Regovacy\'; \'Dubridah\'; \'Rystadda\'; Eandolem\'], 1) returns Arlannal

Solution

function studentName = StudentLookup(classRoster, seatPosition)

for i=1:length(classRoster)

if i==seatPosition

studentName = classRoster(i)

 Assign studentName with the string element at seatPosition in array classRoster. function studentName = Student Lookup (classRoster, seat Position) studentName

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site