MATLAB: Using variable value to name a folder

nameprogrammingtable

hi, i have a variable called Name in workspace and would like to save a table to csv using the Name value. Example: Name=4205; writetable(T,?????);
name of output file should be 4205.csv
thanks!

Best Answer

Name=4205;
writetable(T,sprintf('%d.csv',Name));