✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。
🍎个人主页:Matlab科研工作室
🍊个人信条:格物致知。
更多Matlab仿真内容点击👇
⛄ 内容介绍
1 算法原理
Logistic映射,也称为Logistic函数或Logistic方程,是一个常用的非线性映射函数,用于将输入映射到区间(0, 1)之间。它的形式如下:
f(x) = 1 / (1 + exp(-x))
在Logistic映射中,x是输入值,exp表示自然指数函数(e的幂),f(x)是映射结果。
Logistic映射具有以下特点:
- S形曲线:Logistic映射产生的曲线形状呈现S形,从渐进视角而言,当x趋近正无穷时,f(x)趋近于1,当x趋近负无穷时,f(x)趋近于0。
- 非线性变换:Logistic映射是一种非线性变换函数,能够对输入进行非线性映射。与线性函数不同,Logistic映射引入了非线性因素,可以更好地模拟复杂的关系和行为。
- 限制输出范围:Logistic映射将输入限制在(0, 1)之间,即输出值落在单位间隔内。这种特性使其常用于概率、分类问题以及神经网络等领域中。
Logistic映射在应用领域具有广泛的应用,包括但不限于以下几个方面:
- 生物学模型:Logistic映射在生物学中常用于描述生物种群增长的饱和效应,即当环境资源有限时,种群数量达到一个稳定值。
- 神经网络激活函数:Logistic映射作为神经网络中常用的激活函数之一,用于引入非线性特性,使神经网络能够学习和处理复杂的模式。
- 逻辑回归分类器:Logistic映射被广泛应用于逻辑回归模型中,将输入变量通过Logistic函数映射到(0, 1)的概率值,用于二分类问题的概率估计和决策边界判断。
总而言之,Logistic映射是一种常用的非线性函数,具有S形曲线和输出范围限制的特点,适用于多个领域中的非线性建模和数据处理任务。
⛄ 部分代码
function varargout = sch(varargin)
% SCH MATLAB code for sch.fig
% SCH, by itself, creates a new SCH or raises the existing
% singleton*.
%
% H = SCH returns the handle to a new SCH or the handle to
% the existing singleton*.
%
% SCH('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in SCH.M with the given input arguments.
%
% SCH('Property','Value',...) creates a new SCH or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before sch_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to sch_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 sch
% Last Modified by GUIDE v2.5 23-Mar-2011 16:14:23
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @sch_OpeningFcn, ...
'gui_OutputFcn', @sch_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 sch is made visible.
function sch_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 sch (see VARARGIN)
% Choose default command line output for sch
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes sch wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = sch_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;
% --- Executes on slider movement.
function slider1_Callback(hObject, eventdata, handles)
% hObject handle to slider1 (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,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
value=get(hObject,'value');
set(handles.edit2,'string',value)
% --- Executes during object creation, after setting all properties.
function slider1_CreateFcn(hObject, eventdata, handles)
% hObject handle to slider1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
end
% --- Executes on slider movement.
function slider2_Callback(hObject, eventdata, handles)
% hObject handle to slider2 (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,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
value=get(hObject,'value');
set(handles.edit3,'string',value)
% --- Executes during object creation, after setting all properties.
function slider2_CreateFcn(hObject, eventdata, handles)
% hObject handle to slider2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
end
% --- Executes on slider movement.
function slider3_Callback(hObject, eventdata, handles)
% hObject handle to slider3 (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,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
value=get(hObject,'value');
set(handles.edit4,'string',value)
% --- Executes during object creation, after setting all properties.
function slider3_CreateFcn(hObject, eventdata, handles)
% hObject handle to slider3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
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)
axes(handles.axes1);
cla;
clear r s x1 y1;
a=get(handles.slider1,'Value');
x=get(handles.slider2,'Value');
n=get(handles.slider3,'Value');
j=get(handles.popupmenu1,'Value');
n=fix(n);
grid off;
⛄ 运行结果
⛄ 参考文献
[1] 李萌,穆秀春.基于混沌序列的图像加密技术[J].黑龙江科技信息, 2008(11):2.DOI:10.3969/j.issn.1673-1328.2008.11.038.
[2] 袁涛,张文瑞,阿依先木·阿洪,等.基于Logistic回归的大学生MATLAB课程成绩的影响因素分析[J].科技视界, 2019.DOI:CNKI:SUN:KJSJ.0.2019-23-049.