If you are using R2017b MATLAB version, you could set the UniformRead option to true when creating fileDatastore and that will save you from using cell2underlying. This allows you to create a tall table directly. Here is the documentation: FileDatastore
>> fds = fileDatastore('patients.mat', 'ReadFcn', @(x)struct2table(load(x)), 'UniformRead', true); >> t = tall(fds) t =
Mx10 tall table
Gender LastName Age Weight Smoker Systolic Diastolic Height Location SelfAssessedHealthStatus ________ __________ ___ ______ ______ ________ _________ ______ ___________________________ ________________________
'Male' 'Smith' 38 176 true 124 93 71 'County General Hospital' 'Excellent' 'Male' 'Johnson' 43 163 false 109 77 69 'VA Hospital' 'Fair' 'Female' 'Williams' 38 131 false 125 83 64 'St. Mary's Medical Center' 'Good' 'Female' 'Jones' 40 133 false 117 75 67 'VA Hospital' 'Fair' 'Female' 'Brown' 49 119 false 122 80 64 'County General Hospital' 'Good' 'Female' 'Davis' 46 142 false 121 70 68 'St. Mary's Medical Center' 'Good' 'Female' 'Miller' 33 142 true 130 88 64 'VA Hospital' 'Good' 'Male' 'Wilson' 40 180 false 115 82 68 'VA Hospital' 'Good' : : : : : : : : : : : : : : : : : : : :