Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In matlab code please You have been hired by the United Nations to assess the crime statistics in various countries. Data has been collected and

image text in transcribed In matlab code please
You have been hired by the United Nations to assess the crime statistics in various countries. Data has been collected and sent to you in a file UNDataCrimeStatistics.csv. You have been tasked with analyzing this data. The data consists of intentional homicides: number and rate per 100,000 population^1. The original file has six columns: CountOrArea, Year, Count, Rate, Source and SourceType. The Rate variable is based on deaths per 100,000 population. In some cases, there are several years of data, and other cases only one year of data. We would like to consolidate the data for each country using Matlab. You will need to: Load the data Extract and consolidate the data Sort the data for different fields Plot the data Display the data to the screen Create a function named LoadData, which inputs to the function a string containing the filename of the datafile, and returns from the function a cell array of data, and a header containing the column headings. The output should be a l times 1720 cell array named Data containing each line of the file stored as a string obtained using fgetl. Create a function named ParseData which inputs to the function the cell array Data and separates the strings obtained using fgetl into the fields identified by the header. The output of this function should be a 1719 times 4 cell array named OrigData. This will be stored separately to access the unconsolidated data, if necessary. Strsplit or strtok may not be used.^1http://data.un.org/Explorer.aspx?d=UNODC

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2014 Integration Services

Authors: Brian Knight, Devin Knight

1st Edition

1118850904, 9781118850909

More Books

Students also viewed these Databases questions