Save global variables in matlab. You can export tabular data from matlab workspace into a text file using the writetable function. Alternatively use command syntax for the save operation.