Problem when using imwrite ...
Mostrar comentarios más antiguos
%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{:});
Respuestas (1)
Walter Roberson
el 16 de Feb. de 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 comentarios
Alfredo Torres Arceo
el 16 de Feb. de 2018
Walter Roberson
el 16 de Feb. de 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
el 17 de Feb. de 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
el 17 de Feb. de 2018
Categorías
Más información sobre Image Preview and Device Configuration en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!