Save image using Guide GUI does not work
Afficher commentaires plus anciens
When trying to save an image from my GUI I get the error:
-----------------------------------------------------------------------------
Error using imwrite (line 442)
Expected DATA to be one of these types:
double, single, uint8, uint16, uint32, uint64, int8, int16, int32, int64, logical
Instead its type was matlab.graphics.axis.Axes.
-------------------------------------------------------------------------------------------
I want to save an image that I modified, where I added squares and/or other images (see image). This is the code I am using:
first_c= 'C:\Users\';
user_name= getenv('username');
second_c='\Desktop';
com_path= fullfile(first_c,user_name,second_c);
a= handles.axes1;
defaultFileName = fullfile(com_path, '*.png*');
[baseFileName, folder] = uiputfile(defaultFileName, 'Specify a file');
if baseFileName == 0
% User clicked the Cancel button.
return;
end
fullFileName = fullfile(folder, baseFileName);
imwrite(a, fullFileName);
--------------------------------------------------------------------------------------
Can someone please help me? It is for an important project.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Convert Image Type dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!