Error in this line
image=imread(char(filename{1}));
it looks like filename is a variable of type char or some other but not a cell. if filename is
filename = 'C\User\PPC\Downloads\Im.png';
then
filename{1}
Brace indexing is not supported for variables of this type.
because filename is a char not a cell, now convert it to cell
filename = {'C\User\PPC\Downloads\Im.png'};
then
filename{1}
ans =
'C\User\PPC\Downloads\Im.png'
To save multiple filename in variable filename
filename = {'C\User\PPC\Downloads\Im.png','C\User\PPC\Downloads\Re.png'};
Now you can use
iimage=imread(char(filename{1}));