Gui to app designer

9 ビュー (過去 30 日間)
SOYUN LEE
SOYUN LEE 2020 年 6 月 18 日
回答済み: Aniket 約12時間 前
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 約12時間 前
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 Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by