Problem when using imwrite ...
Show older comments
%The directory where the image will be saved
folder = '\Users\public\Documents\MATLAB\faceBank';
name = strcat(Rnombre,Rapellido,Rcargo,'.jpg');
%Are attributes of which the file name will be composed
imwrite(work_area,fullfile(folder,name));
work_area is the variable that contains the image
i have this error
Error using imwrite>parse_inputs (line 510)
A filename must be supplied.
Error in imwrite (line 418)
[data, map, filename, format, paramPairs] = parse_inputs(varargin{:});
Answers (1)
Walter Roberson
on 16 Feb 2018
In your
strcat(Rnombre,Rapellido,Rcargo,'.jpg')
I suspect that one of those variables is a cell array instead of a character vector.
Also if one of them is numeric then you would need to cross check whether the results would be char or numeric. Do not use strcat to try to insert numeric values into a character vector: see sprintf() or num2str for converting numeric to characters.
4 Comments
Alfredo Torres Arceo
on 16 Feb 2018
Walter Roberson
on 16 Feb 2018
If one of those is a handle to a uicontrol style edit or text for which Max has been set to more than 1, or if one of them is a handle to a uicontrol style push or pop, then get() of the String will return a cell array of character vectors rather than a character vector.
You should use class() to test each of those variables.
Image Analyst
on 17 Feb 2018
Try
Rnombre = char(handles.nombreM.String);
Rapellido = char(handles.apellidoM.String);
Rcorreo = char(handles.correoM.String);
Rcargo = char(handles.cargoM.String);
Alfredo Torres Arceo
on 17 Feb 2018
Categories
Find more on Image Preview and Device Configuration in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!