When you want to check the path using struct variables,
You can use the following function.
#Struct variables
DesktopPath = winqueryreg('HKEY_CURRENT_USER', 'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders', 'Desktop');
app.handles.path.one = strcat(DesktopPath, '\Test\folder1\');
app.handles.path.two = strcat(DesktopPath, '\Test\folder2\');
app.handles.path.three = strcat(DesktopPath, '\Test\folder3\');
#Function
%// how to call function
PathChecker(app.handles.path);
%// Below is the function
function PathChecker (varSet)
if isa(varSet, 'struct')
DataSet = struct2cell(varSet);
DataSetLength = length(DataSet);
for ii = 1 : DataSetLength
Path = DataSet{ii, 1};
if ~exist(Path, 'dir')
mkdir(Path);
end
end
disp('Path Check Completed..');
end
end
#Matlab
#Matlab App Designer
'Memo > Matlab' 카테고리의 다른 글
Matlab : Make & Write Data in PPT file (without PPT API) (0) | 2022.08.09 |
---|---|
Matlab function : Save and load UI values in text (0) | 2022.08.08 |
Matlab function : Update the Text Area with part of a text file (0) | 2022.08.02 |
Matlab : UI drop-down (0) | 2022.08.01 |
Matlab function : Text Area(History log) updater (0) | 2022.08.01 |