Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix uiopen path change in R2024b causing recursion bug #215 #216

Merged
merged 1 commit into from
Mar 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion external/uiopen.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ function uiopen(type,direct)
%
% See also UIGETFILE, UIPUTFILE, OPEN, UIIMPORT.

persistent uiroot
if isempty(uiroot)
uiroot = [matlabroot filesep 'toolbox' filesep 'matlab' filesep 'uitools'];
vervec = cellfun(@(x) sscanf(x, '%d'), split(version, '.'));
if (vervec(1) * 10 + vervec(2)) >= 242
uiroot = [uiroot filesep 'uitools'];
end
end

if numel(type)>3 && strcmpi(type(end+(-3:0)),'.cif') && direct
model = spinw(type);
if ~isempty(model.matom.S)
Expand All @@ -81,7 +90,7 @@ function uiopen(type,direct)
%fprintf('The imported image is stored in the ''img'' variable.\n');
else
pwd0 = pwd;
cd([matlabroot filesep 'toolbox' filesep 'matlab' filesep 'uitools'])
cd(uiroot)
feval('uiopen',type,direct);
cd(pwd0)
end
Loading