Question: Electric utilities keep extensive databases on system failures where and when lines break, transformers blow, and other short-circuits occur. They do this for operational planning
Electric utilities keep extensive databases on system failures where and when lines break, transformers blow, and other short-circuits occur. They do this for operational planning and allocation of maintenance resources. The database could contain information on location, date, type of failure, who reported it, etc. One way this data could be stored in a computer program would be as a struct array. On the website you will find the .mat file class_05_activities_p2_SomeUtilityData.mat. Load this file into MATLAB. It contains the struct array failures. Use the fieldnames function to see what fields are in the struct. Your task is to write a MATLAB code that will extract and use some of the data in the struct array. a) The x- and y-location values are given as meters away from a central location (located at x=0, y=0.) Write a MATLAB script that will plot the locations as circles (on a scatter plot) of all the power system failures in the database. b) Create a new field in the struct called distance, that contains as a value the distance of the failure from the central location (use the simple Euclidean distance formula to calculate this distance.) Calculate this field value for all the entries in the struct array. c) Once you have created the values of the new field distance, write MATLAB code that will find the maximum value in the distance field, and determine the name of the worker who fixed the farthest failure? Hint: max() can return 2 output arguments; look up max function in MATLAB help. d) Create a new struct array that contains all the elements of the failure struct array sorted into order of distance, from closest to farthest away from the central location. Hint: sort() can return 2 output arguments; look up sort function in MATLAB help.
Matlab file: https://drive.google.com/open?id=1_JKa8CrG-2B9Kj7DJQTUlVY7oaKJ_34e
Please write the code in matlab
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
