Use of MATLAB uigetfile () & iscell () Functions

Source: Internet
Author: User


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;



 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.