dir( )


dir( ) function in Matlab


Syntax:           dir(name)

                        listing = dir(name)

Description:   

  • dir(name) lists files and folders that match the string name. When name is a folder, dir lists contents of the folder.
  • listing = dir(name) returns attributes about name.


Note:   dir lists files and folders in MATLAB current folder.






Code :

% Matlab Function - dir
% Syntax : 
% dir(name)
% listing = dir(name)

dir('Hello')

%Function
r = dir('Hello');
r = rmfield(r, 'date');
r = rmfield(r, 'bytes');
r = rmfield(r, 'datenum');

for i = 1 : length(r)
    disp(r(i));
end



No comments:

Post a Comment