MATLAB Image Processing Day 3
1. uigetfile ():
% Fixed format: [filename, pathname, filterindex] = uigetfile (filterspec, dialogtitle, defaultname)
% The meaning of each parameter is:
Filename: returned file name, pathname: returned file path, filterindex: select the file type number
Filterspec: file type setting, dialogtitle: Dialog Box title, defaultname: Default Object Name
% The returned parameter filterindex is the number of the selected filter in the dialog box. The number starts from 1. If you click the cancel button, close dialog box button, or the selected file does not exist, the returned filterindex is 0.
Sample:
% PS: multiselect on multiple options for setting files: when only one file is selected, the returned filename is string. When multiple files are selected, the returned cellular type is
[Fname pname Index] = uigetfile ({'*. JPG ;*. BMP ;*. PNG ;*. TIF ',' image (*. JPG ,*. BMP ,*. PNG ,*. TIF) '}, 'select image', 'f: \ leavesicl \', 'multiselect ', 'on ');
2. iscell ():
% From Baidu encyclopedia, 1 is returned for 'struct' [I .e., iscell ()] that meets cell (cellular array) conditions:
Using a metaphor from a daughter's Country: A metacell is a mother. She has a daughter, which can have a daughter, be single, or be a descendant of mantang, it is critical that a daughter of the same generation does not need to be of the same data type.
The iscell () function mainly makes a judgment,
Sample:
If ~ Iscell (add_fname)
Filename {1} = add_fname;
Else
Filename = add_fname;