Row 1&2 is the DATA of Brunsic Town and rows 2&3 is the data of vidic village Br
ID: 2079074 • Letter: R
Question
Row 1&2 is the DATA of Brunsic Town and rows 2&3 is the data of vidic village
Brunsic Town 45 Vidic Village Data 46 45 45 53 46 45 45 53 53 45 46 54 53 46 51 54 45 39 46 51 51 51 51 39 40 46 51 51 52 51 40 46 40 46 52 52 53 52 40 46 41 47 48 48 49 48 47 A9 42 47 42 48 42 47 43 48 53 48 42 47 42 47 54 42 47 51 48 42 48 51 49 42 48 51 49 43 48 51 48 52 43 49 43 48 53 49 49 43 49 44 43 50 50 49 50 43 49 50 44 49 45 51 45 51 50 44 50 44 50 45 52 45 53 50 45 50 45 53 51 45 54 36 38 46 51 38 51 46 51 45 52 46 51 45Explanation / Answer
% As i am unable to download the data, first i typed all the data into an
% excel sheet in two columns, and now i am imported into a data file, which contains both
% data sets.
[Data, Town]=xlsread('DataSet.xlsx'); % reading the excel sheet data
%%
% Section1: Asks the user to enter the file names for the two data sets
% and then two external data files will be created in the work space. After
% entering the file name press 'OK'
prompt='enter the file name to save data set of BursicTown';
name=inputdlg(prompt);
eval(strcat(name{1},'=Data(:,1);'));
prompt='enter the file name to save data set of VedicVille';
name=inputdlg(prompt);
eval(strcat(name{1},'=Data(:,2);'));
%%
% Section 2: Finds the mean of each Data Set, user have to enter the
% data set name to find the mean pirticular data set; Run this section for
% two times to find the mean of the two data sets
prompt='enter the file name of data set to find the mean';
name=inputdlg(prompt);
eval(strcat('DataSet=',name{1},';'));
N=length(DataSet);
Sum=0;
for i=1:1:N
Sum=Sum+DataSet(i);
end
MeanData=Sum/N;
MeanData=num2str(MeanData);
msgbox(strcat('Mean = ',{' '},MeanData));
%%
% Section 3: Finds the min and max of each Data Set, user have to enter the
% data set name to find the mean pirticular data set; Run this section for
% two times to find the mean of the two data sets
prompt='enter the file name of data set to find the min and max';
name=inputdlg(prompt);
eval(strcat('DataSet=',name{1},';'));
N=length(DataSet);
Datamin=DataSet(1);
Datamax=DataSet(1);
for i=2:1:N;
a=DataSet(i);
if a<=Datamin
Datamin=a;
else if a>Datamax
Datamax=a;
end
end
end
% For verification
Dataminnew=min(DataSet);
Datamaxnew=max(DataSet);
% Verify these values with the data.
%%
%
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.