%% Access Field of Scalar Structure
% Get the value of a field from a structure returned by the what function. what returns a scalar structure with fields containing the path to the specified folder and the names of various kinds of files in the folder.

S = what('C:\Temp')

%
% Return the names of all Live Scripts listed in the mlx field. When you use the getfield function, you can access a field of the structure returned by a function without using a temporary variable to hold that structure.

value = getfield(what('C:\Temp'),'mlx')

%
% You also can access a field using dot notation.

value = S.mlx

% Copyright 2018 The MathWorks, Inc.