当前位置:朝夕网 » 数码科技 » 基于MATLAB的变异系数法GUI计算界面

基于MATLAB的变异系数法GUI计算界面

摘要:讲解变异系数法求权重的原理,并通过MATLAB的GUI界面计算,操作更简单,不会编程也能用。前面讲到的熵权法是一种根据数据的信息确定指标权重的客观的方法。变异系数法是一种利用被评价对象指标的变异

摘要:讲解变异系数法求权重的原理,并通过MATLAB的GUI界面计算,操作更简单,不会编程也能用。

前面讲到的熵权法是一种根据数据的信息确定指标权重的客观的方法。变异系数法是一种利用被评价对象指标的变异程度确定指标权重的方法,可实现被评价对象各指标的动态赋权。指标的变异程度大,说明其在评价对象指标中的重要程度越高,应赋予较大的权重;反之则赋予较小的权重。

总的来说,变异系数法是通过数据的波动性来衡量权重。本人基于MATLAB的GUI界面设计了一个操作简单变异系数法计算功能界面如下:

点击导入数据按键,输入负向指标的位置——点击开始计算——出现结果显示加载的数据表、每个指标对应的权重和每个个体的得分表——同时生成对应的数据结果exce文件:变异系数法得分表.xlsx和变异系数法指标权重.xlsx。需要基于MATLAB的变异系数法的GUI计算界面完整GUI程序,可以进行赞赏后截图(20元及以上),进行联系,或者在微信公众号云龙派中点击公众号“联系掌门”进行联系,或者在公众号内回复截图,几小时内会回复。界面编程不易,还请见谅!


1.界面举例计算

下面是购买轿车的一个决策矩阵,给出了四个方案供我们进行选择,每个方案中均有相同的六个属性(假设第2、4、5、6个为越大越优型指标,即正向指标;第1和3个指标为越小越优型指标,即负向指标),我们需要利用变异系数法求出各属性的权重,以及每个方案的综合分数。

油耗

功率

费用

安全性

维护性

操作性

本田

5

1.4

6

3

5

7

奥迪

9

2

30

7

5

9

桑塔纳

8

1.8

11

5

7

5

别克

12

2.5

18

7

5

5

(1)点击加载数据,输入负向指标列数,选择数据excel文件

(2)点击确定

(3)点击开始计算

(4)结果


2.GUI主要程序如下

function varargout = bianyixishufa
% BIANYIXISHUFA MATLAB code for bianyixishufa.fig
% BIANYIXISHUFA, by itself, creates a new BIANYIXISHUFA or raises the existing
% singleton*.
%
% H = BIANYIXISHUFA returns the handle to a new BIANYIXISHUFA or the handle to
% the existing singleton*.
%
% BIANYIXISHUFA calls the local
% function named CALLBACK in BIANYIXISHUFA.M with the given input arguments.
%
% BIANYIXISHUFA creates a new BIANYIXISHUFA or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before bianyixishufa_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to bianyixishufa_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE&34;GUI allows only one
% instance to run ".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help bianyixishufa

% Last Modified by GUIDE v2.5 10-Apr-2022 11:26:41

% Begin initialization code – DO NOT EDIT
gui_Singleton = 1;
gui_State = struct;
if nargin && ischar
gui_State.gui_Callback = str2func;
end

if nargout
[varargout{1:nargout}] = gui_mainfcn;
else
gui_mainfcn;
end
% End initialization code – DO NOT EDIT

% — Executes just before bianyixishufa is made visible.
function bianyixishufa_OpeningFcn
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data
% varargin command line arguments to bianyixishufa

% Choose default command line output for bianyixishufa
handles.output = hObject;
movegui;
%关闭窗口的名字 修改为其他名字
set;
% Update handles structure
guidata;

% UIWAIT makes bianyixishufa wait for user response
% uiwait;

% — Outputs from this function are returned to the command line.
function varargout = bianyixishufa_OutputFcn
% varargout cell array for returning output args ;
% hObject handle to figure
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data

% Get default command line output from handles structure
varargout{1} = handles.output;

% — Executes on button press in pushbutton1.
function pushbutton1_Callback
% hObject handle to pushbutton1
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data
tableData = [];
set;
set;
set;
set;

% — Executes on button press in pushbutton2.
function pushbutton2_Callback
% hObject handle to pushbutton2
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data
closereq;

% — Executes on button press in pushbutton3.
function pushbutton3_Callback
% hObject handle to pushbutton3
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data
global data
index =str2num);
[w,Score]=bian1;

set;
set;
set;
xlswrite;
xlswrite;


3.理论部分

首先变异系数的公式如下:CV=标准差/平均值。从公式可以看到,其代表数据沿着平均值波动的幅度比例,该值越大意味着波动性越大,而且该种波动性是以平均值作为标准,也就解决掉了量纲化问题。并不会因为某些数据特别大,变异系数就失去意义。简而言之,即变异系数CV值是一种相对波动的衡量指标。

变异系数法求解权重的原理为:数据的波动性可以衡量权重。如果变异系数越大,说明其携带的信息越大,因而权重也会越大,这是变异系数法求解权重的原理。使用变异系数法求解权重的方法,即为变异系数权重法,也称作信息量权重法。

信息量权重法是一种客观赋权法。其思想在于利用数据的变异系数进行权重赋值,如果变异系数越大,说明其携带的信息越大,因而权重也会越大,此种方法适用于专家打分、或者面试官进行面试打分时对评价对象(面试者)进行综合评价。

无量纲化、规范化、归一化是包含关系。无量纲化的概念最广。归一化方法是指,经过归一化计算后,得到的矩阵,矩阵值都在[0,1]之间。常见的六大类归一化方法及注意事项如下:

(注:图片来自知乎作者疯狂绅士,文章链接在本文开始部分。)


参考内容

本文的理论部分的内容主要参考了微信公众号“好玩的MATLAB”的《变异系数法》、知乎作者周老师和疯狂绅士的知乎回答文章,具体知乎文章链接为:

https://www.zhihu.com/question/445121358

https://www.zhihu.com/question/445121358/answer/2419558878


本文内容来源于网络,仅供参考学习,如内容、图片有任何版权问题,请联系处理,24小时内删除。


作 者 | 郭志龙编 辑 | 郭志龙校 对 | 郭志龙

以上就是朝夕生活(www.30zx.com)关于“基于MATLAB的变异系数法GUI计算界面”的详细内容,希望对大家有所帮助!

免责声明:本文版权归原作者所有,转载文章仅为传播更多信息之目的,如有侵权行为,请第一时间联系我们修改或删除,多谢。朝夕网 » 基于MATLAB的变异系数法GUI计算界面