-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGroup1Exe1Prog1.m
More file actions
51 lines (34 loc) · 1.57 KB
/
Copy pathGroup1Exe1Prog1.m
File metadata and controls
51 lines (34 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
% Liouliakis Nikolaos AEM: 10058
% Panagiotis Syskakis AEM: 10045
clear;
close all;
file = "Heathrow.xlsx";
% Make sure the file exists
if exist( file , 'file') ~= 2
fprintf('\nThe file named : %s does not exist in the current directory' , file);
fprintf('\nThe current directory is named : %s \n' , pwd);
return
end
Table = readtable(file);
Names = Table.Properties.VariableNames ;
fprintf('Loaded the file named : %s \n' , file);
final_p_values = zeros(5,numel(Names)) ;
% Iterate over the elements of the cell array
for i = 2:numel(Names)
% Access the element at the current index
element = Names{i};
% Do something with the element
disp(element);
V = Table.Variables ;
V_temp = V(~isnan(V(:,i)),i) ;
[p_1 , p_2 , discrete ,h_1 , h_2 ] = Group1Exe1Fun1(V_temp );
final_p_values(:,i) = [p_1 p_2 discrete h_1 h_2 ] ;
type = [ "continuous" "discrete" ] ;
distrobution_names = [ "Normal" "Uniform" ; "Binomial" "Uniform" ] ;
h_result_string = [ "accepted" "rejected" ] ;
fprintf("The data were interperted as %s \n" , type(discrete+1) );
fprintf("The p-value for %s is %5g and for %s is %5g \n" , distrobution_names(discrete+1 , 1 ) , p_1 ,distrobution_names(discrete+1 , 2 ) , p_2 );
fprintf("The %s distribution is %s and the %s distribution is %s \n" , distrobution_names(discrete+1 , 1 ) , h_result_string(h_1+1) ,distrobution_names(discrete+1 , 2 ) , h_result_string(h_2+1) );
fprintf("\n");
end
final_p_values;