MATLAB: Can one define a “directory” as a “variable”

MATLAB

Suppose I want to use readtable to read a file. I understand the format
readtable('C:\myFolder\myFile.xlsx')
readtable('C:\myFolder\myFile2.xlsx')
But in my case such directory name is very long and it is cumbersome that I need to specify that long directory name each time. Is it possible to define a directory name as a variable and simplify the process?

Best Answer

directory='c:\myfolder';
filename='myfile.xlsx';
readtable(fullfile(directory,filename));