How can i save a output image into a folder ?

imwrite(yourImageArray, filename);
How can i save the output displayed image by using above code?

Answers (1)

That code is correct. Just supply a valid image variable, and a valid filename, and it will work. If it doesn't, read this thoroughly and edit your question so that it's answerable.

6 Comments

How can i set the 'filename' field in that syntax ? can u give me any example?
baseFileName = 'my new image.png'; % Whatever....
fullFileName = fullfile(someFolder, baseFileName);
imwrite(rgbImage, fullFileName);
I got error Undefined function or variable 'Segmented'. Error in Untitled (line 88) fullFileName = fullfile(Segmented, baseFileName)
what do u meant by 'someFolder,? path of the folder or just the folder name? the folder 'segmented' is also in the same folder of the coding files.
someFolder is a string that is the name of the folder you want. It can be a variable or a literal. For examples
fullFileName = fullfile('D:/Valhalla', baseFileName);
or
folder = 'D:/Hawaii Photos/May 2017';
fullFileName = fullfile(folder, baseFileName);
I don't know what your Segmented is but it better be a string and not an image.
Dear sir: I want to transfer image from host pc to another pc's folder. What type of function should I use?
You can use copyfile(). I use it all the time to copy files back and forth to a shared folder on a server.

Sign in to comment.

Categories

Find more on Images in Help Center and File Exchange

Asked:

on 16 Apr 2017

Commented:

on 30 Aug 2020

Community Treasure Hunt

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

Start Hunting!