Error using imwrite>parse_inputs (line 515) The first argument should not be a string

8 visualizaciones (últimos 30 días)
when i use directory name im getting this error.
dr=uigetdir();
A=dir([dr,'\*.jpg']);
for i=1:size(A)
B=strcat(dr,'\',A(i).name);
cd('C:\Users\user17\Documents\MATLAB\C\');
imwrite(B,'newimage.jpg');
  2 comentarios
KSSV
KSSV el 21 de En. de 2019
imwrite is used to write a image......here your B is a string...you can write string using imwrite.....what you are trying to do?
IP student ;(
IP student ;( el 21 de En. de 2019
i want to read images from a folder and write it to another folder

Iniciar sesión para comentar.

Respuestas (1)

Geoff Hayes
Geoff Hayes el 21 de En. de 2019
Rajani - try using copyfile to copy the file from one location to another.

Categorías

Más información sobre File Operations 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