prefdir

Folder containing preferences, settings, history, and layout files

Syntax

folder = prefdir
folder = prefdir(1)

Description

example

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

folder = prefdir(1) creates a folder for preferences 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\R2018b'

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

cd(prefdir)
dir
winopen(prefdir)

Introduced before R2006a