MATLAB: Problem reading table from spreadsheet

readtablespreadsheettable

When I use eg by matlab and load data by following everything works
load patients
whos
e.g this code
T = table(Age,Gender,Height,Weight,Smoker,...
'RowNames',LastName)
—–
But when i use my own excel sheet same data no code works, pleas guide my code is as follows
T=readtable("patients.xls");
T = table(Age,Gender,Height,Weight,Smoker,...
'RowNames',LastName)

Best Answer

The result of readtable() is already a table . But you might want to
T = readtable("patients.xls");
T.Properties.RowNames = T.LastName;