当前位置:网站首页>Matlab bridge span combination problem GUI Graphical interface is completed
Matlab bridge span combination problem GUI Graphical interface is completed
2022-04-22 12:34:00 【Install a sound 77】
function varargout = bijiaoGUI(varargin)
% BIJIAOGUI MATLAB code for bijiaoGUI.fig
% BIJIAOGUI, by itself, creates a new BIJIAOGUI or raises the existing
% singleton*.
%
% H = BIJIAOGUI returns the handle to a new BIJIAOGUI or the handle to
% the existing singleton*.
%
% BIJIAOGUI('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in BIJIAOGUI.M with the given input arguments.
%
% BIJIAOGUI('Property','Value',...) creates a new BIJIAOGUI or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before bijiaoGUI_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to bijiaoGUI_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help bijiaoGUI
% Last Modified by GUIDE v2.5 13-Jul-2018 23:16:27
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @bijiaoGUI_OpeningFcn, ...
'gui_OutputFcn', @bijiaoGUI_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before bijiaoGUI is made visible.
function bijiaoGUI_OpeningFcn(hObject, eventdata, handles, varargin)
% 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 (see GUIDATA)
% varargin command line arguments to bijiaoGUI (see VARARGIN)
set(handles.text1,'visible','off')
set(handles.text2,'visible','off')
set(handles.text4,'visible','off')
% Choose default command line output for bijiaoGUI
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes bijiaoGUI wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = bijiaoGUI_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
function edit1_Callback(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit1 as text
% str2double(get(hObject,'String')) returns contents of edit1 as a double
% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
str1=get(handles.edit1,'String');
KJ=str2num(str1);
%x Deposit data
% Search for functions , Find the combination of all integers
%53 It is the length of one span and can be taken arbitrarily , The general span is 40~60m
% This function only considers vertical segmentation
% Parameterize the span
%K Cross selection equation
YKJ=0.2*KJ-1
% rounding
YY=round(YKJ)
data = [];
for k=3:13
for b=0:0.5:5
a=(KJ-2*b)/k;
if rem(a,1) ~= 0
a;
continue
else
a;b;k;
x=[a,b,k];
data = [data;x];
end
end
end
data
% Filter function , Choose a more suitable combination
index=[];
A=data(:,1);
for i=1:length(A)
if A(i)>=3 & A(i)<=7
index=[index;i];
else
continue
end
end
index
dataX=[];
for i=1:length(index)
aa=data(index(i),:);
dataX=[dataX;aa];
end
dataX
% Average detection , Select several groups of data that are more average
Z=ones(1,size(dataX,1));
AA=5;BB=2.5;KK=YY;
for i=1:size(dataX,1)
Z(i)=abs(dataX(i,1)-AA)/AA+abs(dataX(i,2)-BB)/BB+abs(dataX(i,3)-KK)/KK;
end
Z;
[F,ix]=sort(Z,'descend');
ixx=ix(1,fix(size(dataX,1)/2):size(dataX,1));
% take ixx flashback
ixxx=fliplr(ixx);
dataXX=[];
for i=1:length(ixxx)
p=dataX(ixxx(i),:);
dataXX=[dataXX;p];
end
dataXX;
A2=[]
% Yes a Scoring
for i=1:size(dataXX,1)
A2(i)=abs(dataXX(i,1)-5)/5;
end
A2
ta=tabulate(A2(:))
NZ=size(ta,1)
AAA=[];
for i =1:size(ta,1)
for j=1:length(A2)
if A2(j) == ta(i,1)
AAA(j)=1-(i-1)*(1/NZ);
end
end
end
AAA;
B2=[];
BBB=[];
% Yes b Scoring
for i=1:size(dataXX,1)
B2(i)=abs(dataXX(i,2)-2.5)/2.5;
end
B2;
ta2=tabulate(B2(:))
for i =1:size(ta2,1)
for j=1:length(B2)
if B2(j) == ta2(i,1)
BBB(j)=1-(i-1)*(1/NZ);
end
end
end
BBB;
% Yes c Scoring
K2=[]
KKK=[]
for i=1:size(dataXX,1)
K2(i)=abs(dataXX(i,3)-YY)/YY;
end
K2
ta3=tabulate(K2(:))
for i =1:size(ta3,1)
for j=1:length(K2)
if K2(j) == ta3(i,1)
KKK(j)=1-(i-1)*(1/NZ);
end
end
end
KKK
% Analytic hierarchy process
% Set judgment matrix for
% Consistency index look-up table ,3 rank Ri by 0.58
% In principle, CR Less than 0.1 when , You can consider
P=[1,5,3;
1/5,1,1/3;
1/3,3,1;];
n1=length(P);
ri=[0,0,0.58,0.9,1.12];
[x,y]=eig(P);
lamda=max(diag(y))
cr0=(lamda-n1)/(n1-1)/ri(n1)
ZZJG=[];
if cr0<0.1
disp(' Consistency test passed ')
% normalization , Get the weight coefficient
for i =1:n1
for j=1:n1
PP(i,j)=P(i,j)/sum(sum(P));
end
end
PP
H=sum(PP,2);
for i =1:length(H)
W(i)=H(i)/sum(H);
end
% Weight value
W
x_new=[AAA;BBB;KKK];
PJZ=W*x_new
[Z,xidx]=sort(PJZ,'descend');
xidx
for i=1:length(xidx)
ZZJG=[ZZJG;dataXX(xidx(i),:)];
end
ZZJG2=ZZJG(2:size(ZZJG,1),:);
end
set(handles.text1,'visible','on')
set(handles.text2,'visible','on')
set(handles.text4,'visible','on')
set(handles.text1,'string',' The recommended combination of spans is :','FontSize',12);
set(handles.text2, 'string', num2str(ZZJG),'FontSize',12);
set(handles.text4,'string',' Segment length Length of both sides Span number ','FontSize',12);
版权声明
本文为[Install a sound 77]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204221227431593.html
边栏推荐
猜你喜欢
![[deeply understand tcallusdb technology] delete all data interface descriptions in the list - [list table]](/img/ed/cccd5dee09d2f0a3e6c788bd265b36.png)
[deeply understand tcallusdb technology] delete all data interface descriptions in the list - [list table]

When the new version of redis is released, do you still think redis is a single thread?
![After brushing a thousand multiple-choice questions, I summarized these error prone points of C language [the second bullet]](/img/3e/12697e1cef1de1698928911e82a98f.png)
After brushing a thousand multiple-choice questions, I summarized these error prone points of C language [the second bullet]

Ros2 learning notes (IX) learn the bag recording of ros2 from turnlesim
![[concurrent programming 054] multithreading status and transition process?](/img/b0/7f6bb898fb58477c73023135bd49db.png)
[concurrent programming 054] multithreading status and transition process?

js原生代码实现三级联动效果

Application case sharing of isolated integrated current sensor ch704 which can measure current above 50A

【并发编程052】说说双重检查锁以及其优点?

【并发编程051】volatile 内存语义的实现原理

腾讯云域名绑定
随机推荐
let和var的区别面试题答案
After brushing a thousand multiple-choice questions, I summarized these error prone points of C language [the second bullet]
[concurrent programming 047] cache locking performance is better than bus locking. Why not eliminate bus locking?
[logical fallacies in life] controlling violence with violence and suppressing rationality
Partagez quelques conseils pratiques que vous avez accumulés sur un projet mobile récemment écrit
LeetCode 1608、特殊数组的特征值
What does 0ul or 1ul in STM32 mean?
A记录、MX记录、CNAME记录这些名词是什么意思?
Tell your girlfriend easily: the internal principle of thread pool
[in depth understanding of tcallusdb technology] data interface description for reading the specified location in the list - [list table]
JS随机颜色
ROS2学习笔记(七)从turtlesim学习ROS2的工具
Low frequency (LF) RFID intelligent terminal
3D应用旋转相册
JS基础13
build 知:Makefile
JS native code to achieve three-level linkage effect
Share some practical skills accumulated in a recent mobile terminal project
js原生代码实现三级联动效果
Ros2 learning notes (8) learn the startup file of ros2 from turnlesim