when I call the image why does not appear?

a=uigetfile();
filename=a;
setappdata(0,'filename',filename);
a=imread(a);
axes(handles.axes1);
imshow(a);
setappdata(0,'a',a);
setappdata(0,'filename',a);
plot(handles.axes1,'a');

1 comentario

Rik
Rik el 13 de Jun. de 2023
Why exactly are you using this code? Why do you expect plot to display an image?
If you have trouble with Matlab basics you may consider doing the Onramp tutorial (which is provided for free by Mathworks).

Iniciar sesión para comentar.

Respuestas (1)

Image Analyst
Image Analyst el 13 de Jun. de 2023
You don't need to do anything with appdata. Simply do this:
% Have user browse for a file, from a specified "starting folder."
% For convenience in browsing, set a starting folder from which to browse.
startingFolder = pwd; % or 'C:\wherever';
if ~isfolder(startingFolder)
% If that folder doesn't exist, just start in the current folder.
startingFolder = pwd;
end
% Get the name of the file that the user wants to use.
defaultFileName = fullfile(startingFolder, '*.*');
[baseFileName, folder] = uigetfile(defaultFileName, 'Select a file');
if baseFileName == 0
% User clicked the Cancel button.
return;
end
fullFileName = fullfile(folder, baseFileName)
% Read image into an array.
rgbImage = imread(fullFileName);
% Display the image.
imshow(rgbImage, []);

1 comentario

Image Analyst
Image Analyst el 13 de Jun. de 2023
It's a generic, general purpose demo of how to threshold an image to find blobs, and then measure things about the blobs, and extract certain blobs based on their areas or diameters.

Iniciar sesión para comentar.

Categorías

Más información sobre Convert Image Type en Centro de ayuda y File Exchange.

Preguntada:

nio
el 13 de Jun. de 2023

Comentada:

el 13 de Jun. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by