Problem when using imwrite ...
显示 更早的评论
%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{:});
回答(1 个)
Walter Roberson
2018-2-16
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 个评论
Alfredo Torres Arceo
2018-2-16
Walter Roberson
2018-2-16
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
2018-2-17
Try
Rnombre = char(handles.nombreM.String);
Rapellido = char(handles.apellidoM.String);
Rcorreo = char(handles.correoM.String);
Rcargo = char(handles.cargoM.String);
Alfredo Torres Arceo
2018-2-17
类别
在 帮助中心 和 File Exchange 中查找有关 Image Preview and Device Configuration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!