如何从该列表框中读取选定的jpg并在轴中查看它?
function selectFolderButtonPushed(app, event)
app.selectedPath = uigetdir();
jpgFileInfo = dir(fullfile(app.selectedPath, '*.jpg'));
app.jpgListBox.Items = {jpgFileInfo.name}';
end
function loadimageButtonPushed(app, event)
imageSelected = imread(......);
imshow(imageSelected, app.imageAxes);
end
我希望它能有所帮助:
function SelectFolderButtonPushed(app, event)
app.selectedPath = uigetdir();
jpgFileInfo = dir(fullfile(app.selectedPath, '*.jpg'))
app.jpgListBox.Items = {jpgFileInfo.name}';
end
function loadimageButtonPushed(app, event)
selectedFileName = app.jpgListBox.Value;
selectedPath = app.selectedPath;
imageSelected =strcat(selectedPath, "", selectedFileName)
imshow(imageSelected,'Parent',app.imageAxes);
end