Problem when using imwrite ...
Mostra commenti meno recenti
%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{:});
Risposte (1)
Walter Roberson
il 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 Commenti
Alfredo Torres Arceo
il 16 Feb 2018
Walter Roberson
il 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
il 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
il 17 Feb 2018
Categorie
Scopri di più su Image Preview and Device Configuration in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!