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

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 件のコメント

KSSV
KSSV 2019 年 1 月 21 日
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 ;( 2019 年 1 月 21 日
i want to read images from a folder and write it to another folder

サインインしてコメントする。

回答 (1 件)

Geoff Hayes
Geoff Hayes 2019 年 1 月 21 日

0 投票

Rajani - try using copyfile to copy the file from one location to another.

カテゴリ

ヘルプ センター および File ExchangeFile Operations についてさらに検索

タグ

質問済み:

2019 年 1 月 21 日

回答済み:

2019 年 1 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by