你的调用格式错了,应该用的是小括号(),而不是大括号。
这是matlab中help userpath中的一段
userpath(path) changes the current value of the primary userpath to the
folder passed in. It updates the current MATLAB path, and this
new primary userpath will persist across MATLAB sessions.
userpath('reset') resets the primary userpath to the default. It updates
the current MATLAB path, and this new primary userpath will persist across
MATLAB sessions.
userpath('clear') removes the primary userpath. It updates the current
MATLAB path, and this new primary userpath will persist across MATLAB sessions.
调用用的是小括号的。