MATLAB: How to select a random row from an excel sheet which has 16801 rows and 28 columns

excelrows

i have an excel sheet of 16801×28 and want to randomly select one row out of this to give it as a input to my kalman filter i just want to know how can i select a row randomly with a code instead of doing it manually ?
Thanks in advance

Best Answer

num_row = size(YourArray, 1);
random_row_number = randi(num_row);
random_row = YourArray(random_row_number, :);
The compact version of this is:
random_row = YourArray( randi(size(YourArray,1)), :);