Gui to app designer

9 次查看(过去 30 天)
SOYUN LEE
SOYUN LEE 2020-6-18
回答: Aniket 2024-11-21,5:01
It's a gui code. Please change it to the code used by the app designer.
function clmap_Callback(hObject, eventdata, handles)
global g;
get(handles.figure1,'SelectionType');
if strcmp(get(handles.figure1,'SelectionType'),'normal')
index_selected = get(handles.listbox1,'Value');
file_list = get(handles.listbox1,'String');
filename = file_list{index_selected};
if handles.is_dir(handles.sorted_index(index_selected))
if strcmp(filename,'..')
handles.dfolder = fileparts(handles.dfolder);
% cd (filename)
load_listbox(handles.dfolder,handles)
elseif strcmp(filename,'.')
else
handles.dfolder = fullfile(handles.dfolder,filename);
% cd (filename)
load_listbox(handles.dfolder,handles)
end
else
fname = strtrim(filename);
fullname = fullfile(handles.dfolder , fname);
try
metadata = dicominfo(fullname);
catch
disp ('apparently not a DICOM file');
return
end
img = dicomread(fullname);
g.img=img;
clim =get(gca,'Clim');
clbarstat = get(handles.uitoggletool3,'State');
himg=imagesc(img);
set(himg,'ButtonDownFcn',@axes1_ButtonDownFcn);
set(himg,'UIContextMenu',handles.clmap);
if clim~=[0 1]
set(gca,'Clim', clim);
end
axis off
if strcmp(clbarstat,'on')
colorbar
end
ch = get(handles.HeaderList, 'value');
fields=char(fieldnames(metadata));
len = setdiff (1:size(fields,1), handles.hidden);
id=0;
for k=len,
estr=eval(['metadata.' fields(k,:)]);
if ischar(estr)
str=[fields(k,:) ' : ' estr];
elseif isnumeric(estr)
str=[fields(k,:) ' : ' num2str(estr(1:min(3,end))')];
else
str=[fields(k,:) ' : ...'];
end
id = id+1;
cstr{id}=sprintf('%3d %s',k,str);
end
set(handles.HeaderList,'Value',ch);
set(handles.HeaderList,'String',cstr);
guidata(hObject, handles);
return;
end
end
  1 个评论
Sampath Rachumallu
Sampath Rachumallu 2020-6-26
编辑:Sampath Rachumallu 2020-6-26
There is a matlab addon called "GUIDE to App Designer Migration Tool for MATLAB" . You can install it and use it to migrate guide gui to Appdesigner gui.

请先登录,再进行评论。

回答(1 个)

Aniket
Aniket 2024-11-21,5:01
You can convert your GUIDE app into App Designer depending on the MATLAB version you are using:
1. Starting with R2023a, you can run the migration tool from the MATLAB command line by downloading the tool and then calling the "appmigration.migrateGUIDEApp" function. To know more about this function, kindly follow this documentation:
2. For previous releases, you may use GUIDE to App Designer Migration Tool for MATLAB by MathWorks Team to convert app.
Hope this helps!

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by