You cannot generally convert .mat file to excel.
You can potentially convert to excel under the special case that the .mat file contains exactly one variable, and the one variable is a scalar or vector or 2D numeric, or the one variable is a 2D cell array (each entry of which is empty or scalar numeric or character vector or scalar string), or the one variable is a struct array in which each field of the array is empty or scalar numeric or character vector or scalar string, or the variable is a table() object.
If the .mat file contains a single variable that is scalar or vector or 2D numeric, then extract the variable from the .mat file and writearray()
If the .mat file contains a single variable that is a 2D cell array, then extract the variable from the .mat file and writecell()
If the .mat file contains a single variable that is a table() object, then extract the variable from the .mat file and writetable()
If the .mat file contains a single variable that is a struct array, then extract the variable from the .mat file and struct2table() and writetable()
If the .mat file contains more than one variable, then the best you can do is somehow group all of the variables together and write out the result -- or to write out the individual variables as different sheets in the excel file.