Percent of food sales data correlation analysis clear;% initialization parameters Catering_sale = '. /data/catering_sale_all.xls '; % dining data, containing other attributes index = 1; % of sales data in the column is read in data [num,txt] = Xlsread (catering_sale);% read num%% correlation analysis corr_ = Corr (num);%corr_= linear dependent (num) percent print result rows = Size (co rr_,1);% rows = Fetch Length (corr_, count rows) for i=2:rows% the correlation coefficients of the loop variable i=2 to ten disp ([' "' txt{1,2} '" and "' Txt{1,1+i} ') are: ' Num2str ( Corr_ (i,1)]); end% printing [steamed chicken claw in lily Sauce] and other menu related factors are: corr_ (i,1) disp (' Food and beverage products daily sales correlation analysis completed! ‘);
The results show:
The correlation coefficient of "steamed chicken claw with lily sauce" and "steamed fragrant dumplings with emerald" is: 0.0092058
The correlation coefficient of "steamed chicken claw with lily sauce" and "steamed ribs with garlic sauce" is: 0.016799
The correlation coefficient of "steamed chicken claw with lily sauce" and "true Flavor Chicken" is: 0.45564
The correlation coefficients of "steamed chicken claw with lily sauce" and "Honey Juice Baked Package" are: NaN
The correlation coefficient of "steamed chicken claw with lily sauce" and "raw stir-frying Heart" is: 0.3085
"Steamed chicken claw with lily sauce" and "hot plate pickled cabbage tofu" correlation coefficient is: 0.2049
The correlation coefficient of "steamed chicken claw with lily sauce" and "fried leek dumplings" is: 0.12745
The correlation coefficient of "steamed chicken claw with lily sauce" and "Pan fried Cake" is:-0.090276
The correlation coefficient of "steamed chicken claw with lily sauce" and "Original Dish Heart" is: 0.42832
The correlation analysis of food and beverage daily Sales is complete!
Important syntax: Matlab Corr (data correlation)
Matalb related sub-method, Case study: Correlation analysis of food and beverage sales data