Borrar filtros
Borrar filtros

how to use imwrite in matlab?

13 visualizaciones (últimos 30 días)
Anushka
Anushka el 17 de Jun. de 2015
Respondida: kass el 29 de En. de 2020
how to use imwrite in matlab?The file which that we are specifying to write,should it be already be created in the folder?

Respuestas (4)

Walter Roberson
Walter Roberson el 17 de Jun. de 2015
No. If the file does not already exist then it will be created. If the file does already exist then it will be overwritten.
  4 comentarios
Abdoo
Abdoo el 18 de Jun. de 2015
Editada: Abdoo el 18 de Jun. de 2015
Notice, Check the file is close before you go on, because can't write data and file is open.
Guillaume
Guillaume el 18 de Jun. de 2015
Note: to close all open file handles:
fclose all

Iniciar sesión para comentar.


B.k Sumedha
B.k Sumedha el 17 de Jun. de 2015
Editada: B.k Sumedha el 17 de Jun. de 2015
imwrite(A,filename,fmt);
This is the general format of imwrite. Its not necessary that image needs to be present in ur folder. Where A is ur image which u want to save,specify the file name and its format. For ex:
imwrite(im_DIF,'Image difference.bmp','bmp');
  4 comentarios
mima  zebouchi
mima zebouchi el 18 de Abr. de 2016
but what about imrwite of dicom images plz i need answer
Walter Roberson
Walter Roberson el 18 de Abr. de 2016
You cannot use imwrite() to write dicom images. You need dicomwrite()

Iniciar sesión para comentar.


Alejandro Cruz Rubio
Alejandro Cruz Rubio el 1 de Jun. de 2019
Anyone Know how to save a block of images with imwrite?
  8 comentarios
Alejandro Cruz Rubio
Alejandro Cruz Rubio el 3 de Jun. de 2019
Editada: Rik el 3 de Jun. de 2019
My version of Matlab is 2018b. Yeah I solve the problem with K and k and I get the same error. And if I use the arrayCells inside of for, that is:
for k=1:numel(arrayCells)
filename = sprintf('Output_block_%d.png', K);
imwrite(arrayCells{k}, filename);
end
I get this error: "Error using imwrite (line 433)
Unable to determine the file format from the file name" because I use arrayCells but if I use "block" I don´t have any problem but I don´t get my goal
Rik
Rik el 3 de Jun. de 2019
With the code you show you actually haven't fixed the code yet. The code below should work a lot better.
for k=1:numel(arrayCells)
filename = sprintf('Output_block_%d.png', k);%<--- lower case k, instead of upper case K
imwrite(arrayCells{k}, filename);
end

Iniciar sesión para comentar.


kass
kass el 29 de En. de 2020
for k=1:numel(I)
imwrite(I{k}, ['filename' num2str(k) '.pgm']);
end
%I is arraycells

Categorías

Más información sobre Import, Export, and Conversion en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by