当前位置:网站首页>MATLAB小技巧(16)矩阵特征向量特征值求解一致性验证--层次分析
MATLAB小技巧(16)矩阵特征向量特征值求解一致性验证--层次分析
2022-07-01 08:15:00 【mozun2020】
MATLAB小技巧(16)矩阵特征向量特征值求解一致性验证--层次分析
前言
MATLAB进行图像处理相关的学习是非常友好的,可以从零开始,对基础的图像处理都已经有了封装好的许多可直接调用的函数,这个系列文章的话主要就是介绍一些大家在MATLAB中常用一些概念函数进行例程演示!
对矩阵的特征值与特征向量进行求解,根据最大特征值与对应特征向量,得到准则层特征向量与准则层最大特征根,再进行一致性检验参数计算,满足阈值则为满足一致性验证,不满足阈值则需进行重新评分。
搜寻资料的时候遇到的这个示例,这里分享给大家,MATLAB版本为MATLAB2015b。
一. MATLAB仿真
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%功能:矩阵特征向量特征值求解一致性验证--层次分析示例
%环境:Win7,Matlab2015b
%Modi: C.S
%时间:2022-06-24
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 清空环境变量
clear all
clc
tic
A=[1 1/5 1 1/5 1/6 1/6
5 1 5 1/2 1/2 1/2
2 1/5 1 1/4 1/6 1/4
5 1/2 4 1 1/2 1/2
6 2 6 2 1 1
6 2 4 2 1 1]
[n,n]=size(A);
[V,D]=eig(A);%求得特征向量和特征值
%求出最大特征值和它所对应的特征向量
tempNum=D(1,1);
pos=1;
for h=1:n
if D(h,h)>tempNum
tempNum=D(h,h);
pos=h;
end
end
w=abs(V(:,pos));
w=w/sum(w);
t=D(pos,pos);
disp('准则层特征向量w=');disp(w);disp('准则层最大特征根t=');disp(t);
%以下是一致性检验
CI=(t-n)/(n-1);RI=[0 0 0.58 0.89 1.12 1.26 1.36 1.41 1.46 1.49 1.52 1.54 1.56 1.58 1.59 1.60 1.61 1.615 1.62 1.63];
CR=CI/RI(n);
if CR<0.10
disp('此矩阵的一致性可以接受!');
disp('CI=');disp(CI);
disp('CR=');disp(CR);
else
disp('此矩阵的一致性验证失败,请重新进行评分!');
end
toc
二. 仿真结果
A =
1.0000 0.2000 1.0000 0.2000 0.1667 0.1667
5.0000 1.0000 5.0000 0.5000 0.5000 0.5000
2.0000 0.2000 1.0000 0.2500 0.1667 0.2500
5.0000 0.5000 4.0000 1.0000 0.5000 0.5000
6.0000 2.0000 6.0000 2.0000 1.0000 1.0000
6.0000 2.0000 4.0000 2.0000 1.0000 1.0000
准则层特征向量w=
0.0425
0.1677
0.0546
0.1580
0.2976
0.2797
准则层最大特征根t=
6.0846
此矩阵的一致性可以接受!
CI=
0.0169
CR=
0.0134
时间已过 0.007250 秒。

三. 小结
一致性验证的示例,后期可能会用到,这里做个笔记。每天学一个MATLAB小知识,大家一起来学习进步阿!
边栏推荐
猜你喜欢

Manually dig XSS vulnerabilities

Keithley 2100 software 𞓜 Keithley2400 test software ns SourceMeter

There are many problems in sewage treatment, and the automatic control system of pump station is solved in this way

【入门】取近似值

Soft keyboard height error

谈谈数字化转型的几个关键问题

7-26 word length (input and output in the loop)

Hijacking a user's browser with beef
![[untitled]](/img/be/3523d0c14d555b293673af2b6fbcff.jpg)
[untitled]

【入门】输入n个整数,输出其中最小的k个
随机推荐
leetcode T31:下一排列
Aardio - Method of self constructed geticonhandle
Thread safety analysis of [concurrent programming JUC] variables
Set up file server Minio for quick use
Book of quantitative trading - reading notes of the man who conquers the market
2022.6.30 省赛+蓝桥国赛记录
Maneuvering target tracking -- current statistical model (CS model) extended Kalman filter / unscented Kalman filter matlab implementation
量化交易之读书篇 - 《征服市场的人》读书笔记
防“活化”照片蒙混过关,数据宝“活体检测+人脸识别”让刷脸更安全
Leetcode T39: 组合总和
Intelligent constant pressure irrigation system
Count number of rows per group and add result to original data frame
String coordinates of number to excel
shardingSphere
[getting started] input n integers and output the smallest K of them
Cmake I two ways to compile source files
Leetcode t40: combined sum II
Codeforces Round #803 (Div. 2) VP补题
5大组合拳,解决校园6大难题,护航教育信息化建设
empirical study and case study