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

10 visualizzazioni (ultimi 30 giorni)
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 Commenti
KSSV
KSSV il 21 Gen 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?

Accedi per commentare.

Risposte (1)

Geoff Hayes
Geoff Hayes il 21 Gen 2019
Rajani - try using copyfile to copy the file from one location to another.

Categorie

Scopri di più su File Operations in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by