Question: MATLAB Question - 5 ( Using Structs ) : Structs are useful in many situations when dealing with diverse data. For example, get the contents

MATLAB
Question-5(Using Structs):
Structs are useful in many situations when dealing with diverse data. For example, get the contents of your
current directory by typing a=dir;
a.,a is a struct array. What is its size? What are the names of the fields in a?
b. Write a loop to go through all the elements of a, and if the element is not a directory, display the
following sentence 'File filename contains x bytes', where filename is the name of the file and x is
the number of bytes.
c. Write a function called displayDir.m, which will display the sizes of the files in the current
directory when run, as below. Your output may have different filenames.
 MATLAB Question-5(Using Structs): Structs are useful in many situations when dealing

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!