File path containing %
18 views (last 30 days)
Zoltán Csáti on 13 Aug 2015
I would like to get the path for directories containing % (like %MATLAB_ROOT%, %APPDATA%, etc.) in Windows. However, functions like fileparts cannot interpret the percent sign. Is there a way to make this possible within MATLAB, or the only solution is to call system commands?
per isakson on 13 Aug 2015
Edited: per isakson on 13 Aug 2015
Use getenv, Environment variable to get values of environment variables of the underlying operating system, e.g.
%NAME% gets the value of NAME in the Command Prompt, e.g.
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
And there is the Matlab function, matlabroot