Question: Calculating the size of a directory The MATLAB function dir returns the contents of a specified directory. It returns the result in the form of
Calculating the size of a directory The MATLAB function dir returns the contents of a specified directory. It returns the result in the form of an structure array with four fields, for example,
where here, the directory contains 123 objects. Write a MATLAB function that takes the path to a directory and outputs the total size of all files in the directory in units of bytes.
4. Calculating the size of a directory The MATLAB function dir returns the contents of a specified directory. It returns the result in the form of an structure array with four fields, for example, >>s=dir 123x1 struct array with fields: name date bytes isdir datenunm >size(s) ans 123 >>fieldnamess ans name date bytes isdir' datenum ere here, the directory contains 123 objects. Write a MATLAB function that takes the path to a directo nd outputs the total size of all files in the directory in units of bytes
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
