Without a concrete example of your intended goal, its a little hard to give an exact answer. However, going off of your description, the following maybe of help to you:
Additionally, a possible solution with readtable and writetable, would be as follows:
>> T = table(['M';'F';'M'],[45; 41; 40],...
{'NY';'CA';'MA'},[true;false;false]);
T =
3×4 table
Var1 Var2 Var3 Var4
____ ____ ____ _____
M 45 'NY' true
F 41 'CA' false
M 40 'MA' false
>> writetable(T,'myData.xls');
>> % Do stuff in MATLAB and create a table to write to a specific range in a sheet (append)
>> x = table('M',50,'AZ',true);
>> writetable(x,'myData.xls','Range','A5:D5','WriteVariableNames',false);
>> readtable('myData.xls')
ans =
4×4 table
Var1 Var2 Var3 Var4
____ ____ ____ _____
'M' 45 'NY' true
'F' 41 'CA' false
'M' 40 'MA' false
'M' 50 'AZ' true
If you want more control on readtable format for the variables, you can consider using detectImportOptions along with setvaropts and readtable.