Main Content

prefdir

Folder containing settings and layout files

Description

folder = prefdir returns the name of the settings folder. The settings folder contains settings for MATLAB® and related products, MATLAB favorites files, and MATLAB desktop layout files.

example

folder = prefdir(1) creates a folder for settings and related files if one does not exist. If the folder does exist, the name is assigned to folder.

Examples

collapse all

prefdir
ans =
    'C:\Users\username\AppData\Roaming\MathWorks\MATLAB\R2025a'

Set the current folder to the settings folder and then view the contents of the folder.

cd(prefdir)
dir
winopen(prefdir)

Extended Capabilities

expand all

Thread-Based Environment
Run code in the background using MATLAB® backgroundPool or accelerate code with Parallel Computing Toolbox™ ThreadPool.

Version History

Introduced before R2006a

expand all