Question: MATLAB Question - 5 ( Using Structs ) : Structs are useful in many situations when dealing with diverse data. For example, get the contents
MATLAB
QuestionUsing Structs:
Structs are useful in many situations when dealing with diverse data. For example, get the contents of your
current directory by typing dir;
a is a struct array. What is its size? What are the names of the fields in
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 bytes', where filename is the name of the file and 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.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
