Question: We can construct an array of structures. For example, suppose we have the following table: table [ [ Name , Job,Num ] , [

We can construct an array of structures. For example, suppose we have the following table:
\table[[Name,Job,Num],[Doug,Teacher,39],[Loren,Developer,21],[Jiro,Doctor,67]]
We want to create an array of structures called people. The structures in people will be name, job, num. For example, people (1).name = 'Doug'.
Write a script file that answers the following questions:
a) Finish defining the array of 3 structures in the variable people.
b) Return the letter 'g' in 'Doug' using the array of structures.
c) Write the following code fragment in your script. If your structure is defined correctly, the code should work without error.
for j=1:3
fprintf ('The name of employee %d is %sin, people (j).num, people (j).name); end
We can construct an array of structures. For

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 Programming Questions!