matlab连续卷积动画实现(gui编程)

一.代码运行结果

在这里插入图片描述

二.代码

function varargout = tianqi(varargin)
% TIANQI MATLAB code for tianqi.fig
%      TIANQI, by itself, creates a new TIANQI or raises the existing
%      singleton*.
%
%      H = TIANQI returns the handle to a new TIANQI or the handle to
%      the existing singleton*.
%
%      TIANQI('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in TIANQI.M with the given input arguments.
%
%      TIANQI('Property','Value',...) creates a new TIANQI or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before tianqi_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to tianqi_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 tianqi% Last Modified by GUIDE v2.5 18-Oct-2020 21:54:40% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...'gui_Singleton',  gui_Singleton, ...'gui_OpeningFcn', @tianqi_OpeningFcn, ...'gui_OutputFcn',  @tianqi_OutputFcn, ...'gui_LayoutFcn',  [] , ...'gui_Callback',   []);
if nargin && ischar(varargin{1})gui_State.gui_Callback = str2func(varargin{1});
endif nargout[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
elsegui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT% --- Executes just before tianqi is made visible.
function tianqi_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 tianqi (see VARARGIN)% Choose default command line output for tianqi
handles.output = hObject;% Update handles structure
guidata(hObject, handles);% UIWAIT makes tianqi wait for user response (see UIRESUME)
% uiwait(handles.figure1);% --- Outputs from this function are returned to the command line.
function varargout = tianqi_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 button press in pushbutton1.
% 绘制x图形
function pushbutton1_Callback(hObject, eventdata, handles)
res1=get(handles.edit1,'String');  %获取参数a(string)
res2=get(handles.edit2,'String');  %获取参数b(string)
if isempty(res1)msgbox('input a first','warn','warn');return
elsea=str2double(res1);   %判断a是否为空值
end
if isempty(res2)msgbox('input b first','warn','warn');return
elseb=str2double(res2);  %判断b是否为空值
end
choose_x=get(handles.popupmenu1,'value');  
%获取函数x类型
switch choose_xcase 1   %门函数if b<=0msgbox('b should be positive','warn','warn');returnend
t_start=a-b/2;
t_end=a+b/2;  %门函数起点与终点
x_start=t_start-3;  %限定x坐标轴范围
x_end=t_end+3;
t=x_start:0.001:x_end;%定义时间向量
f=@(t) (t.*0+1).*(t>=t_start&t<=t_end);%使用函数句柄定义门函数,门高为1
yt=f(t);  %创建门函数
y_end=max(yt)*1.1;%限定y坐标轴范围
axes(handles.axes1); %画图像在坐标轴1
plot(t,yt);  %绘图
axis([x_start,x_end,0,y_end]);  %限定坐标轴范围
grid on;  %打开网格线case 2 %三角函数if b<=0msgbox('b should be positive','warn','warn');returnendt_start=a-b/2;
t_end=a+b/2;   %三角函数起点与终点
x_start=t_start-3;  %限定x坐标轴范围
x_end=t_end+3;
t=x_start:0.001:x_end;%定义时间向量
t_center=(t_start+t_end)/2;
t_width=t_end-t_start;   %三角函数中心与宽度
a10=t_center;
b10=t_width;
f=@(t) ((2/b10).*t-(2*a10/b10)+1).*(t>=t_start&t<=t_center)+((-2/b10).*t+(2*a10/b10)+1).*(t>t_center&t<=t_end);
%使用函数句柄定义三角函数
yt=f(t);  %创建三角函数
y_end=max(yt)*1.1;%限定y坐标轴范围
axes(handles.axes1);   %画图像在坐标轴1
plot(t,yt);
axis([x_start,x_end,0,y_end]);
grid on;case 3 %阶跃函数if a==0msgbox('a can not be zero','warn','warn');returnendb10=b;
a10=a;
x_start=b10/a10-3;  %限定x坐标轴范围
x_end=b10/a10+3;
t=x_start:0.001:x_end;%定义时间向量
f=@(t) (t.*0+1).*((a10.*t-b10)>=0); %使用函数句柄定义阶跃函数
yt=f(t);  
y_end=max(yt)*1.1;%限定y坐标轴范围
axes(handles.axes1);
plot(t,yt);
axis([x_start,x_end,0,y_end]);case 4 %冲激函数if a==0msgbox('a can not be zero','warn','warn');returnendsyms f t;   b10=b;
a10=a;
f=dirac(a10*t-b10);  %定义冲激函数
x_start=b10/a10-3;  %限定x坐标轴范围
x_end=b10/a10+3;
tv=x_start:0.001:x_end;%定义时间向量
ft=double(subs(f,t,tv));  %用时间向量tv替代t
ft(find(ft==inf))=1;   %将冲激函数中无穷大量改为1
axes(handles.axes1);
plot(tv,ft);
axis([x_start x_end 0 1 ]);case 5 %单边指数if a==0msgbox('a can not be zero,due to some reasons that exsit on sources codes','warn','warn');returnenda10=a;
b10=b;
x_start=-3;  %限定x坐标轴范围
x_end=3;
t=x_start:0.001:x_end;%定义时间向量
f=@(t)  (a10*exp(-abs(b10).*t)).*(t>=0); %使用函数句柄定义单边指数信号
yt=f(t);  
y_start=min(yt)*1.1;
y_end=max(yt)*1.1;%限定y坐标轴范围
axes(handles.axes1);
plot(t,yt);
axis([x_start,x_end,y_start,y_end]);
grid on;case 6 %单边正弦波if a==0msgbox('a can not be zero,due to some reasons that exist on sources codes','warn','warn');returnenda10=a;
b10=b;
x_start=-pi/abs(a10)  ;  %限定x坐标轴范围
x_end=3*pi/abs(a) ;
t=x_start:0.001:x_end;%定义时间向量
f=@(t)  sin(a10.*t+b10).*(t>=0);
yt=f(t);  
y_end=max(yt)*1.1;%限定y坐标轴范围
y_start=min(yt)*1.1;
axes(handles.axes1);
plot(t,yt);
axis([x_start,x_end,y_start,y_end]);
grid on;
end
% 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)% --- Executes on button press in pushbutton2.
%绘制y图象
function pushbutton2_Callback(hObject, eventdata, handles)
res1=get(handles.edit3,'String');
res2=get(handles.edit4,'String');
if isempty(res1)msgbox('input a first','warn','warn');return
elsea=str2double(res1);
end
if isempty(res2)msgbox('input b first','warn','warn');return
elseb=str2double(res2);
end
choose_y=get(handles.popupmenu2,'value');
switch choose_ycase 1   %门函数if b<=0msgbox('b should be positive','warn','warn');returnend
t_start=a-b/2;
t_end=a+b/2;
x_start=t_start-3;  %限定x坐标轴范围
x_end=t_end+3;
t=x_start:0.001:x_end;%定义时间向量
f=@(t) (t.*0+1).*(t>=t_start&t<=t_end);%使用函数句柄定义门函数,门高为1
yt=f(t);  %创建门函数
y_end=max(yt)*1.1;%限定y坐标轴范围
axes(handles.axes2);
plot(t,yt,'r');
axis([x_start,x_end,0,y_end]);
grid on;case 2 %三角函数if b<=0msgbox('b should be positive','warn','warn');returnendt_start=a-b/2;
t_end=a+b/2;
x_start=t_start-3;  %限定x坐标轴范围
x_end=t_end+3;
t=x_start:0.001:x_end;%定义时间向量
t_center=(t_start+t_end)/2;
t_width=t_end-t_start;
a10=t_center;
b10=t_width;
f=@(t) ((2/b10).*t-(2*a10/b10)+1).*(t>=t_start&t<=t_center)+((-2/b10).*t+(2*a10/b10)+1).*(t>t_center&t<=t_end);
%使用函数句柄定义三角函数
yt=f(t);  %创建三角函数
y_end=max(yt)*1.1;%限定y坐标轴范围
axes(handles.axes2);
plot(t,yt,'r');
axis([x_start,x_end,0,y_end]);
grid on;case 3 %阶跃函数if a==0msgbox('a can not be zero','warn','warn');returnendb10=b;
a10=a;
x_start=b10/a10-3;  %限定x坐标轴范围
x_end=b10/a10+3;
t=x_start:0.001:x_end;%定义时间向量
f=@(t) (t.*0+1).*((a10.*t-b10)>=0);
yt=f(t);  
y_end=max(yt)*1.1;%限定y坐标轴范围
axes(handles.axes2);
plot(t,yt,'r');
axis([x_start,x_end,0,y_end]);case 4 %冲激函数if a==0msgbox('a can not be zero','warn','warn');returnendsyms f t;b10=b;
a10=a;
f=dirac(a10*t-b10);  %定义冲激函数
x_start=b10/a10-3;  %限定x坐标轴范围
x_end=b10/a10+3;
tv=x_start:0.001:x_end;%定义时间向量
ft=double(subs(f,t,tv));  %用时间向量tv替代t
ft(find(ft==inf))=1;
axes(handles.axes2);
plot(tv,ft,'r');
axis([x_start x_end 0 1 ]);
grid on;case 5 %单边指数if a==0msgbox('a can not be zero,due to some reasons that exsit on sources codes','warn','warn');returnenda10=a;
b10=b;
x_start=-3;  %限定x坐标轴范围
x_end=3;
t=x_start:0.001:x_end;%定义时间向量
f=@(t)  (a10*exp(-abs(b10).*t)).*(t>=0);
yt=f(t);  
y_start=min(yt)*1.1;
y_end=max(yt)*1.1;%限定y坐标轴范围
axes(handles.axes2);
plot(t,yt,'r');
axis([x_start,x_end,y_start,y_end]);
grid on;case 6 %单边正弦波if a==0msgbox('a can not be zero,due to some reasons that exist on sources codes','warn','warn');returnenda10=a;
b10=b;
x_start=-pi/abs(a10)  ;  %限定x坐标轴范围
x_end=3*pi/abs(a) ;
t=x_start:0.001:x_end;%定义时间向量
f=@(t)  sin(a10.*t+b10).*(t>=0);
yt=f(t);  
y_end=max(yt)*1.1;%限定y坐标轴范围
y_start=min(yt)*1.1;
axes(handles.axes2);
plot(t,yt,'r');
axis([x_start,x_end,y_start,y_end]);
grid on;end
% hObject    handle to pushbutton2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)% --- Executes on button press in pushbutton3.
%卷积运算
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
global flag;
flag=1;
choose1=get(handles.popupmenu1,'value');
choose2=get(handles.popupmenu2,'value');
res1=get(handles.edit1,'String');
res2=get(handles.edit2,'String');
res3=get(handles.edit3,'String');
res4=get(handles.edit4,'String');
if isempty(res1)msgbox('input a first','warn','warn');return
elsea1=str2double(res1);
end
if isempty(res2)msgbox('input b first','warn','warn');return
elseb1=str2double(res2);
end
if isempty(res3)msgbox('input b first','warn','warn');return
elsea2=str2double(res3);
end
if isempty(res4)msgbox('input b first','warn','warn');return
elseb2=str2double(res4);
end
switch choose2   %函数y图形(g表示)case 1   %门函数if b2<=0msgbox('b should be positive','warn','warn');returnendsyms   x g2;g2=heaviside(x-(a2-b2/2))-heaviside(x-(a2+b2/2));%利用阶跃函数构建门函数
t2_start=a2-b2/2;  %门函数左边界
t2_end=a2+b2/2;  %门函数右边界
g=@(t) (t.*0+1).*(t>=t2_start&t<=t2_end)+0;%使用函数句柄定义门函数,门高为1
switch choose1 %函数x图形(f表示)case 1 %门函数if b1<=0msgbox('b should be positive','warn','warn');returnend
t1_start=a1-b1/2;  %门函数左边界
t1_end=a1+b1/2;  %门函数右边界
x_start=t1_start+t2_start-3;  %坐标轴3左边界
x_end=t1_end+t2_end+3;   %坐标轴3右边界
y_start =-0.5;
if  b1>b2y_end=b2*1.1;
elsey_end=b1*1.1;
end
f=@(t) (t.*0+1).*(t>=t1_start&t<=t1_end)+0;%使用函数句柄定义门函数,门高为1case 2 %三角函数if b1<=0msgbox('b should be positive','warn','warn');returnendt1_start=a1-b1/2;  %三角函数左边界
t1_end=a1+b1/2;   %三角函数右边界
x_start=t1_start+t2_start-3;  %坐标轴3左边界
x_end=t1_end+t2_end+3;  %坐标轴3右边界
y_start =-0.5;
if  (b1/2)>b2y_end=b2*1.1;
elsey_end=(b1/2)*1.1;
end
t1_center=a1;   %三角函数中心
t1_width=b1;    %三角函数宽度
a=t1_center;
b=t1_width;
f=@(t) ((2/b).*t-(2*a/b)+1).*(t>=t1_start&t<=t1_center)+((-2/b).*t+(2*a/b)+1).*(t>t1_center&t<=t1_end);case 3 %阶跃函数if a1==0msgbox('a can not be zero','warn','warn');returnend
x1_start=b1/a1-3;  
x1_end=b1/a1+3; %阶跃函数左右边界
a=a1;
b=b1;
f=@(t) (t.*0+1).*((a.*t-b)>=0);
x_start=x1_start+t2_start-3;
x_end=x1_end+t2_end+3;
y_start=-0.5;
y_end=b2*1.1;case 4 %冲激函数if a1==0msgbox('a can not be zero','warn','warn');returnendsyms f;syms tao;x1_start=b1/a1-3;  
x1_end=b1/a1+3;  %冲激函数左右边界
x_start=x1_start+t2_start-3;
x_end=x1_end+t2_end+3;
y_start=-0.5;
if abs(a1)>1y_end=1.1;
else
y_end=round(1/abs(a1),1)*1.1;
endx_of_f=x_start:0.01:x_end;%定义时间向量f=dirac(a1*tao-b1);  %定义冲激函数y_of_f=double(subs(f,tao,x_of_f));% 将tao替换为x_of_fy_of_f(find(  y_of_f==inf))=1;%将冲激函数中的无穷大改为1xy_tao=f*subs(g2,x,x-tao);%将y中的x用x-tao替换xy=simplify(simplify(int(xy_tao,tao,-100,100)));%卷积过程case 5 %单边指数信号if a1==0msgbox('a can not be zero,due to some reasons that exsit on sources codes','warn','warn');returnenda10=a1;
b10=b1;
x1_start=-3; 
x1_end=3;
f=@(t)  (a10*exp(-abs(b10).*t)).*(t>=0);
x_start=x1_start+t2_start-3;
x_end=x1_end+t2_end+3;
y_start=min((a1<0)*a1*b2,a1*b2*(a1>0));
y_end=max((a1<0)*a1*b2,a1*b2*(a1>0));case 6 %单边正弦波if a2==0msgbox('a can not be zero,due to some reasons that exsit on sources codes','warn','warn');returnenda10=a1;
b10=b1;
x1_start=-pi/abs(a10)  ;  
x1_end=3*pi/abs(a10) ;
f=@(t)  sin(a10.*t+b10).*(t>=0);
x_start=x1_start+t2_start-3;
x_end=x1_end+t2_end+3;
y_start=-3;
y_end=3;
end
case 2   %函数y图形三角函数syms x g2;t2_start=a2-b2/2;
t2_end=a2+b2/2;
t2_center=a2;
t2_width=b2;
a=t2_center;
b=t2_width;
g=@(t) ((2/b).*t-(2*a/b)+1).*(t>=t2_start&t<=t2_center)+((-2/b).*t+(2*a/b)+1).*(t>t2_center&t<=t2_end);g2=(heaviside(x-(a2-b2/2))-heaviside(x-a2))*(x-(a2-b2/2))*2/b2+(heaviside(x-a2)-heaviside(x-(a2+b2/2)))*(-x+(a2+b2/2))*2/b2;
switch choose1 %函数x图形(f表示)case 1 %门函数if b1<=0msgbox('b should be positive','warn','warn');returnend
t1_start=a1-b1/2;
t1_end=a1+b1/2;
x_start=t1_start+t2_start-3;
x_end=t1_end+t2_end+3;
f=@(t) (t.*0+1).*(t>=t1_start&t<=t1_end)+0;%使用函数句柄定义门函数,门高为1
y_start=-0.5;
if (b2/2)>b1y_end=b1*1.1;
elsey_end=(b2/2)*1.1;
end
case 2 %三角函数if b1<=0msgbox('b should be positive','warn','warn');returnendt1_start=a1-b1/2;
t1_end=a1+b1/2;
x_start=t1_start+t2_start-3;
x_end=t1_end+t2_end+3;
y_start=-0.5;
if (b2/2)>(b1/2)y_end=(b1/2)*1.1;
elsey_end=(b2/2)*1.1;
end
t1_center=a1;
t1_width=b1;
a=t1_center;
b=t1_width;
f=@(t) ((2/b).*t-(2*a/b)+1).*(t>=t1_start&t<=t1_center)+((-2/b).*t+(2*a/b)+1).*(t>t1_center&t<=t1_end);case 3 %阶跃函数if a1==0msgbox('a can not be zero','warn','warn');returnend
x1_start=b1/a1-3;  
x1_end=b1/a1+3; %阶跃函数左右边界
a=a1;
b=b1;
f=@(t) (t.*0+1).*((a.*t-b)>=0);
x_start=x1_start+t2_start-3;
x_end=x1_end+t2_end+3;
y_start=-0.5;
y_end=(b2/2)*1.1;
case 4 %冲激函数if a1==0msgbox('a can not be zero','warn','warn');returnendsyms f;syms tao;f=dirac(a1*tao-b1);  %定义冲激函数x1_start=b1/a1-3;  
x1_end=b1/a1+3;  %冲激函数左右边界
x_start=x1_start+t2_start-3;
x_end=x1_end+t2_end+3;
y_start=-0.5;
if abs(a1)>1y_end=1.1;
else
y_end=round(1/abs(a1),1)*1.1;
endx_of_f=x_start:0.01:x_end;%定义时间向量y_of_f=double(subs(f,tao,x_of_f));% 将tao替换为x_of_fy_of_f(find(  y_of_f==inf))=1;%将冲激函数中的无穷大改为1xy_tao=f*subs(g2,x,x-tao);%将y中的x用x-tao替换xy=simplify(simplify(int(xy_tao,tao,-100,100)));%卷积过程case 5 %单边指数信号if a1==0msgbox('a can not be zero,due to some reasons that exsit on sources codes','warn','warn');returnenda10=a1;
b10=b1;
x1_start=-3; 
x1_end=3;
f=@(t)  (a10*exp(-abs(b10).*t)).*(t>=0);
x_start=x1_start+t2_start-3;
x_end=x1_end+t2_end+3;
y_start=min((a1<0)*a1*(b2/2),a1*(b2/2)*(a1>0));
y_end=max((a1<0)*a1*(b2/2),a1*(b2/2)*(a1>0));case 6 %单边正弦波if a2==0msgbox('a can not be zero,due to some reasons that exsit on sources codes','warn','warn');returnenda10=a1;
b10=b1;
x1_start=-pi/abs(a10)  ;  
x1_end=3*pi/abs(a10) ;
f=@(t)  sin(a10.*t+b10).*(t>=0);
x_start=x1_start+t2_start-3;
x_end=x1_end+t2_end+3;
y_start=-3;
y_end=3;
end
case 3 %函数y图形阶跃函数syms x g2;x2_start=b2/a2-3;  
x2_end=b2/a2+3;
a=a2;
b=b2;
g=@(t) (t.*0+1).*((a.*t-b)>=0);
g2=heaviside(a2*x-b2);
switch choose1 %函数x图形(f表示)case 1 %门函数if b1<=0msgbox('b should be positive','warn','warn');returnend
t1_start=a1-b1/2;
t1_end=a1+b1/2;
x_start=t1_start+x2_start-3;
x_end=t1_end+x2_end+3;
y_start=-0.5;
y_end=b1*1.1;
f=@(t) (t.*0+1).*(t>=t1_start&t<=t1_end)+0;%使用函数句柄定义门函数,门高为1case 2 %三角函数if b1<=0msgbox('b should be positive','warn','warn');returnendt1_start=a1-b1/2;
t1_end=a1+b1/2;
x_start=t1_start+x2_start-3;
x_end=t1_end+x2_end+3;
y_start=-0.5;
y_end=(b1/2)*1.1;
t1_center=a1;
t1_width=b1;
a=t1_center;
b=t1_width;
f=@(t) ((2/b).*t-(2*a/b)+1).*(t>=t1_start&t<=t1_center)+((-2/b).*t+(2*a/b)+1).*(t>t1_center&t<=t1_end);case 3 %阶跃函数if a1==0msgbox('a can not be zero','warn','warn');returnend
x1_start=b1/a1-3;  
x1_end=b1/a1+3; %阶跃函数左右边界
a=a1;
b=b1;
f=@(t) (t.*0+1).*((a.*t-b)>=0);
x_start=x1_start+x2_start-3;
x_end=x1_end+x2_end+3;
y_start=-0.5;
y_end=10;case 4 %冲激函数if a1==0msgbox('a can not be zero','warn','warn');returnendsyms f;syms tao;f=dirac(a1*tao-b1);  %定义冲激函数x1_start=b1/a1-3;  
x1_end=b1/a1+3;  %冲激函数左右边界
x_start=x1_start+x2_start-3;
x_end=x1_end+x2_end+3;
y_start=-0.5;
if abs(a1)>1y_end=1.1;
else
y_end=round(1/abs(a1),1)*1.1;
end
x_of_f=x_start:0.01:x_end;%定义时间向量y_of_f=double(subs(f,tao,x_of_f));% 将tao替换为x_of_fy_of_f(find(  y_of_f==inf))=1;%将冲激函数中的无穷大改为1xy_tao=f*subs(g2,x,x-tao);%将y中的x用x-tao替换xy=simplify(simplify(int(xy_tao,tao,-100,100)));%卷积过程case 5 %单边指数信号if a1==0msgbox('a can not be zero,due to some reasons that exsit on sources codes','warn','warn');returnenda10=a1;
b10=b1;
x1_start=-3; 
x1_end=3;
f=@(t)  (a10*exp(-abs(b10).*t)).*(t>=0);
x_start=x1_start+x2_start-3;
x_end=x1_end+x2_end+3;
y_start=min((a1<0)*a1*2,a1*2*(a1>0));
y_end=max((a1<0)*a1*2,a1*2*(a1>0));case 6 %单边正弦波if a2==0msgbox('a can not be zero,due to some reasons that exsit on sources codes','warn','warn');returnenda10=a1;
b10=b1;
x1_start=-pi/abs(a10)  ;  
x1_end=3*pi/abs(a10) ;
f=@(t)  sin(a10.*t+b10).*(t>=0);
x_start=x1_start+x2_start-3;
x_end=x1_end+x2_end+3;
y_start=-3;
y_end=3;
endcase 4 %函数y图形冲激函数syms t f tao g2 x;t2_start=b2/a2-3;t2_end=b2/a2+3;g2=dirac(a2*x-b2);switch choose1  %函数x图形(f表示)case 1  if b1<=0msgbox('b should be positive','warn','warn');returnend
t1_start=a1-b1/2;
t1_end=a1+b1/2;
x_start=t1_start+t2_start;
x_end=t1_end+t2_end;
y_start=-0.5;
if abs(a2)>1y_end=1.1;
else
y_end=round(1/abs(a2),1)*1.1;
endf=heaviside(tao-(a1-b1/2))-heaviside(tao-(a1+b1/2));%利用阶跃函数构建门函数xy_tao=f*subs(g2,x,x-tao);%将y中的x用x-tao替换xy=simplify(simplify(int(xy_tao,tao,-100,100)));%卷积过程case  2if b1<=0msgbox('b should be positive','warn','warn');returnendt1_start=a1-b1/2;
t1_end=a1+b1/2;
x_start=t1_start+t2_start;
x_end=t1_end+t2_end;
y_start=-0.5;
if abs(a2)>1y_end=1.1;
else
y_end=round(1/abs(a2),1)*1.1;
endf=(heaviside(tao-(a1-b1/2))-heaviside(tao-a1))*(tao-(a1-b1/2))*2/b1+(heaviside(tao-a1)-heaviside(tao-(a1+b1/2)))*(-tao+(a1+b1/2))*2/b1;%利用阶跃函数构建三角函数xy_tao=f*subs(g2,x,x-tao);%将y中的x用x-tao替换xy=simplify(simplify(int(xy_tao,tao,-100,100)));%卷积过程case 3if a1==0msgbox('a can not be zero','warn','warn');returnend
x1_start=b1/a1-3;  
x1_end=b1/a1-3; %阶跃函数左右边界
if abs(a2)>1y_end=1.1;
else
y_end=round(1/abs(a2),1)*1.1;end
y_start=-0.5;f=heaviside(a1*tao-b1);%阶跃函数表达式x_start=x1_start+t2_start;
x_end=x1_end+t2_end;
xy_tao=f*subs(g2,x,x-tao);%将y中的x用x-tao替换xy=simplify(simplify(int(xy_tao,tao,-100,100)));%卷积过程case 4if a1==0msgbox('a can not be zero','warn','warn');returnendx1_start=b1/a1-3;  
x1_end=b1/a1+3;  %冲激函数左右边界
x_start=x1_start+t2_start;
x_end=x1_end+t2_end;
if abs(a2)>1y_end=1.1;
else
y_end=round(1/abs(a2),1)*1.1;
end
y_start=-0.5;f=dirac(a1*tao-b1);%冲激函数表达式xy_tao=f*subs(g2,x,x-tao);%将y中的x用x-tao替换xy=simplify(simplify(int(xy_tao,tao,-100,100)));%卷积过程case 5 %单边指数信号if a1==0msgbox('a can not be zero,due to some reasons that exsit on sources codes','warn','warn');returnendx1_start=-3; 
x1_end=3;
x_start=x1_start+t2_start;
x_end=x1_end+t2_end;
if abs(a2)>1y_start=-abs(a1);y_end=abs(a1);
elsey_start=-abs(a1)/abs(a2);y_end=abs(a1)/abs(a2);
endf= a1*exp(-abs(b1)*tao)*heaviside(tao);xy_tao=f*subs(g2,x,x-tao);%将y中的x用x-tao替换xy=simplify(simplify(int(xy_tao,tao,-100,100)));%卷积过程case 6 %单边正弦波if a2==0msgbox('a can not be zero,due to some reasons that exsit on sources codes','warn','warn');returnendx1_start=round(-pi/abs(a1) ,2) ;  
x1_end=round(3*pi/abs(a1),2) ;
x_start=x1_start+t2_start;
x_end=x1_end+t2_end;
if abs(a2)>1y_start=-3;y_end=3;
elsey_start=-(1/abs(a2))*1.1;y_end=(1/abs(a2))*1.1;
endf=sin(a1*tao+b1)*heaviside(tao);xy_tao=f*subs(g2,x,x-tao);%将y中的x用x-tao替换xy=simplify(simplify(int(xy_tao,tao,-100,100)));%卷积过程endcase  5 %函数y图形单边指数函数t2_start=-3;  %限定x坐标轴范围
t2_end=3;
a=a2;
b=b2;
g=@(t)  (a*exp(-abs(b).*t)).*(t>=0);
syms g2 x;g2=a2*exp(-abs(b2)*x)*heaviside(x);switch choose1 %函数x图形(f表示)case 1 %门函数if b1<=0msgbox('b should be positive','warn','warn');returnend
t1_start=a1-b1/2;
t1_end=a1+b1/2;
x_start=t1_start+t2_start-3;
x_end=t1_end+t2_end+3;
y_start=min((a2<0)*a2*b1,a2*b1*(a2>0));
y_end=max((a2<0)*a2*b1,a2*b1*(a2>0));
f=@(t) (t.*0+1).*(t>=t1_start&t<=t1_end)+0;%使用函数句柄定义门函数,门高为1case 2 %三角函数if b1<=0msgbox('b should be positive','warn','warn');returnendt1_start=a1-b1/2;
t1_end=a1+b1/2;
x_start=t1_start+t2_start-3;
x_end=t1_end+t2_end+3;
y_start=min((a2<0)*a2*(b1/2),a2*(b1/2)*(a2>0));
y_end=max((a2<0)*a2*(b1/2),a2*(b1/2)*(a2>0));
t1_center=a1;
t1_width=b1;
a=t1_center;
b=t1_width;
f=@(t) ((2/b).*t-(2*a/b)+1).*(t>=t1_start&t<=t1_center)+((-2/b).*t+(2*a/b)+1).*(t>t1_center&t<=t1_end);case 3 %阶跃函数if a1==0msgbox('a can not be zero','warn','warn');returnend
x1_start=b1/a1-3;  
x1_end=b1/a1+3; %阶跃函数左右边界
a=a1;
b=b1;
f=@(t) (t.*0+1).*((a.*t-b)>=0);
x_start=x1_start+t2_start-3;
x_end=x1_end+t2_end+3;
y_start=-abs(a2);
y_end=abs(a2);case 4 %冲激函数if a1==0msgbox('a can not be zero','warn','warn');returnendsyms f;syms tao;f=dirac(a1*tao-b1);  %定义冲激函数x1_start=b1/a1-3;  
x1_end=b1/a1+3;  %冲激函数左右边界
x_start=x1_start+t2_start-3;
x_end=x1_end+t2_end+3;
if abs(a1)>1y_start=-abs(a2);y_end=abs(a2);
elsey_start=-abs(a2)/abs(a1);y_end=abs(a2)/abs(a1);
end
x_of_f=x_start:0.01:x_end;%定义时间向量y_of_f=double(subs(f,tao,x_of_f));% 将tao替换为x_of_fy_of_f(find(  y_of_f==inf))=1;%将冲激函数中的无穷大改为1xy_tao=f*subs(g2,x,x-tao);%将y中的x用x-tao替换xy=simplify(simplify(int(xy_tao,tao,-100,100)));%卷积过程case 5 %单边指数信号if a1==0msgbox('a can not be zero,due to some reasons that exsit on sources codes','warn','warn');returnenda10=a1;
b10=b1;
x1_start=-3; 
x1_end=3;
f=@(t)  (a10*exp(-abs(b10).*t)).*(t>=0);
x_start=x1_start+t2_start-3;
x_end=x1_end+t2_end+3;
top=abs(a1)+abs(a2);
y_start=-top;
y_end=top;case 6 %单边正弦波if a2==0msgbox('a can not be zero,due to some reasons that exsit on sources codes','warn','warn');returnenda10=a1;
b10=b1;
x1_start=-pi/abs(a10)  ;  
x1_end=3*pi/abs(a10) ;
f=@(t)  sin(a10.*t+b10).*(t>=0);
x_start=x1_start+t2_start-3;
x_end=x1_end+t2_end+3;
y_start=-3;
y_end=3;
end
case 6 %函数y图形单边正弦波syms g2 x;g2=sin(a2*x+b2)*heaviside(x);
t2_start=round(-pi/abs(a2),2)  ;  
t2_end=round(3*pi/abs(a2),2) ;
g=@(t)  sin(a2.*t+b2).*(t>=0);switch choose1 %函数x图形(f表示)case 1 %门函数if b1<=0msgbox('b should be positive','warn','warn');returnend
t1_start=a1-b1/2;
t1_end=a1+b1/2;
x_start=t1_start+t2_start-3;
x_end=t1_end+t2_end+3;
y_start=-3;
y_end=3;
f=@(t) (t.*0+1).*(t>=t1_start&t<=t1_end)+0;%使用函数句柄定义门函数,门高为1case 2 %三角函数if b1<=0msgbox('b should be positive','warn','warn');returnendt1_start=a1-b1/2;
t1_end=a1+b1/2;
x_start=t1_start+t2_start-3;
x_end=t1_end+t2_end+3;
y_start=-3;
y_end=3;
t1_center=a1;
t1_width=b1;
a=t1_center;
b=t1_width;
f=@(t) ((2/b).*t-(2*a/b)+1).*(t>=t1_start&t<=t1_center)+((-2/b).*t+(2*a/b)+1).*(t>t1_center&t<=t1_end);case 3 %阶跃函数if a1==0msgbox('a can not be zero','warn','warn');returnend
x1_start=b1/a1-3;  
x1_end=b1/a1+3; %阶跃函数左右边界
a=a1;
b=b1;
f=@(t) (t.*0+1).*((a.*t-b)>=0);
x_start=x1_start+t2_start-3;
x_end=x1_end+t2_end+3;
y_start=-3;
y_end=3;case 4 %冲激函数if a1==0msgbox('a can not be zero','warn','warn');returnendsyms f;syms tao;f=dirac(a1*tao-b1);  %定义冲激函数x1_start=b1/a1-3;  
x1_end=b1/a1+3;  %冲激函数左右边界
x_start=x1_start+t2_start-3;
x_end=x1_end+t2_end+3;
y_start=-3;
y_end=3;
x_of_f=x_start:0.01:x_end;%定义时间向量y_of_f=double(subs(f,tao,x_of_f));% 将tao替换为x_of_fy_of_f(find(  y_of_f==inf))=1;%将冲激函数中的无穷大改为1xy_tao=f*subs(g2,x,x-tao);%将y中的x用x-tao替换xy=simplify(simplify(int(xy_tao,tao,-100,100)));%卷积过程case 5 %单边指数信号if a1==0msgbox('a can not be zero,due to some reasons that exsit on sources codes','warn','warn');returnenda10=a1;
b10=b1;
x1_start=-3; 
x1_end=3;
f=@(t)  (a10*exp(-abs(b10).*t)).*(t>=0);
x_start=x1_start+t2_start-3;
x_end=x1_end+t2_end+3;
y_start=-3;
y_end=3;case 6 %单边正弦波if a2==0msgbox('a can not be zero,due to some reasons that exsit on sources codes','warn','warn');returnenda10=a1;
b10=b1;
x1_start=-pi/abs(a10)  ;  
x1_end=3*pi/abs(a10) ;
f=@(t)  sin(a10.*t+b10).*(t>=0);
x_start=x1_start+t2_start-3;
x_end=x1_end+t2_end+3;
y_start=-3;
y_end=3;
end
end 
if choose2 ==4syms g g3 tao x;x_of_g=x_start:0.01:x_end;axes(handles.axes3);cla reset;grid on;hold on;%坐标轴范围axis([x_start x_end y_start y_end]);fplot(f,[x_start x_end ]);H=round(b2/a2,2);g=dirac(x-tao-H); %定义冲激函数g3=subs(g,tao,x_of_g);for  t=x_start:0.01:x_end
y_of_g=subs(g3,x,t);y_of_g(find(y_of_g==inf))=1;y_of_g_plot=plot(x_of_g,y_of_g,'r');res=double(subs(xy,x,t));plot(t,res,'.');pause(0.1);if flag ==0uiwait(handles.figure1);end
delete(y_of_g_plot);endreturn
end
if choose1 == 4  %冲激函数另作讨论x_of_g=x_start:0.01:x_end; %定义函数y时间向量axes(handles.axes3);cla reset; %清空坐标系hold  on;   %将多张图绘到一个坐标系上grid on;plot(x_of_f,y_of_f,'b');  %绘制x(tao)%坐标轴范围
axis([x_start x_end  y_start y_end]);
for t=x_start:0.01:x_endy_of_g=g(t-x_of_g);y_of_g_plot=plot(x_of_g,y_of_g,'r');  %绘制y(t-tao)pause(0.1);  %暂定目的看清绘制过程res=double(subs(xy,x,t));  %卷积xy中x用数值t替代plot(t,res,'.');   %绘制卷积结果,注意是一个又一个点if flag ==0uiwait(handles.figure1);enddelete(y_of_g_plot);
endreturn
end
%一般情况
x_of_f=x_start:0.01:x_end;  %定义函数x时间向量
y_of_f=f(x_of_f);   %得到x的纵坐标
x_of_g=x_start:0.01:x_end;   %定义函数y时间向量axes(handles.axes3);cla reset;  %清空坐标系hold  on;   %将多张图绘到一个坐标系上grid on;plot(x_of_f,y_of_f,'b');%绘制x(tao)%坐标轴范围
axis([x_start x_end  y_start y_end]);
for t=x_start:0.01:x_endy_of_g=g(t-x_of_g);  y_of_g_plot=plot(x_of_g,y_of_g,'r');  %绘制y(t-tao)pause(0.1);  %暂定目的看清绘制过程sum=0;  %求卷积积分for tao=x_start:0.01:x_endsum=sum+0.01*f(tao)*g(t-tao);  %乘以0.01目的,归一化endplot(t,sum,'.');   %绘制卷积结果,注意是一个又一个点if flag ==0uiwait(handles.figure1);enddelete(y_of_g_plot);
end% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)% --- Executes on selection change in popupmenu1.
function popupmenu1_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu1 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu1% --- Executes during object creation, after setting all properties.
function popupmenu1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called% Hint: popupmenu 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');
endfunction 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
function edit2_Callback(hObject, eventdata, handles)
% hObject    handle to edit2 (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 edit2 as text
%        str2double(get(hObject,'String')) returns contents of edit2 as a double
% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit2 (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 selection change in popupmenu2.
function popupmenu2_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu2 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu2
% --- Executes during object creation, after setting all properties.
function popupmenu2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
% Hint: popupmenu 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
function edit3_Callback(hObject, eventdata, handles)
% hObject    handle to edit3 (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 edit3 as text
%        str2double(get(hObject,'String')) returns contents of edit3 as a double
% --- Executes during object creation, after setting all properties.
function edit3_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit3 (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
function edit4_Callback(hObject, eventdata, handles)
% hObject    handle to edit4 (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 edit4 as text
%        str2double(get(hObject,'String')) returns contents of edit4 as a double
% --- Executes during object creation, after setting all properties.
function edit4_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit4 (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 pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton5 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
global flag;
str=get(handles.pushbutton5,'String');
if isequal(str,'pause')flag=0;set(handles.pushbutton5,'String','continue');
elseflag=1;uiresume(handles.figure1);set(handles.pushbutton5,'String','pause');
end

三.界面布局

在这里插入图片描述
三个按钮从上到下依次为:
函数x图形:pushbutton1
函数y图形:pushbutton2
运算:pushbutton3
pause:pushbutton5
可编辑文本框从上到下依次为
edit1
edit2
edit3
edit4
下拉菜单从上到下依次为
popupmenu1
popupmenu2
其余为静态文本框
下载代码链接:
点击下载代码

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/261449.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Ubuntu GNOME 15.10升级16.4LTS

为什么80%的码农都做不了架构师&#xff1f;>>> 当Ubuntu GNOME官方已经发送16.4后&#xff0c;执行以下命令 sudo do-release-upgrade 显示没有新系统更新 在网上找到另一种方法是执行以下命令&#xff1a; sudo ppa-purge ppa:gnome3-team/gnome3-staging sudo p…

matplotlib plot 分组_小白学 Python 数据分析(16):Matplotlib(一)坐标系

人生苦短&#xff0c;我用 Python前文传送门&#xff1a;小白学 Python 数据分析(1)&#xff1a;数据分析基础小白学 Python 数据分析(2)&#xff1a;Pandas (一)概述小白学 Python 数据分析(3)&#xff1a;Pandas (二)数据结构 Series小白学 Python 数据分析(4)&#xff1a;Pa…

2016-04-29 二分查找的面试题

为什么80%的码农都做不了架构师&#xff1f;>>> 1.面试题 例如&#xff1a; ip计算后的值&#xff1d;53文本内容&#xff1a;1,100,北京 101,1000,上海 1001,3001,广州 ...求ip53对应的省份2.代码如下&#xff1a; #!/usr/bin/python # coding: utf8def ip_find(i…

gettype拿不到值_王者荣耀:被低估的强势打野,就是这位拿大锤子的阿姨!

王者峡谷的小伙伴你们好&#xff0c;今天就为你们推荐一下这位野区女霸主钟无艳&#xff0c;不仅高伤害而且操作简单&#xff01;版本更新在5月14日版本更新中&#xff0c;钟无艳的三个技能都被加强了&#xff0c;所有的蓝耗都被固定&#xff0c;不再随技能等级的成长值&#x…

【笔记】MATLAB中的图形(2)

三维作图 1、mesh(z)语句 mesh(z)语句可以给出矩阵z元素的三维消隐图&#xff0c;网络表面由z坐标点定义&#xff0c;与前面叙述的x-y平面的线格相同&#xff0c;图形由临近的点连接而成。它可用来显示用其他方式难以输出的包含大量数据的大型矩阵&#xff0c;也可以用来绘制z变…

Kindeditor放置两个调用readonly错误

开始 需要调用Kindeditor中的readonly的方法&#xff0c;但是一直提示edit is undefined 而editor.readonly(true)又只对第一个对象有效 所以只能换换形式&#xff0c;干脆将下面的kindeditor拿上来 虽然是满足自己这个需求&#xff0c;但是真正的原因解决办法&#xff0c;还是…

acl在内核里的位置_Linux 进程在内核眼中是什么样子的?

本篇算是进程管理的的揭幕篇&#xff0c;简单介绍一个进程在内核眼里的来龙去脉&#xff0c;为接下来的进程创建&#xff0c;进程调度&#xff0c;进程管理等篇章做好学习准备。从程序到进程再到内核啥是程序&#xff0c;啥是进程&#xff0c;一张图可以给我们解释&#xff1a;…

majikan

转载于:https://www.cnblogs.com/YOUEN/p/3179091.html

经典中的品味:第一章 C++的Hello,World!

“程序设计要通过编写程序的实践来学习”—Brian Kernighan 1.1 程序 何为程序?简单的说&#xff0c;就是为了使计算机能够做事&#xff0c;你需要在繁琐的细节中告诉它怎么做。对于怎么做的描述就是程序。编程是书写和测试怎么做的过程。维基百科上说&#xff0c;一个程序就像…

使用eclipse svn塔建(配置)时的一点点心得

有没有人遇到下面这种情况&#xff1f;&#xff1f;自己创建的SVN如下&#xff1a; 但网上别人搭建好的是这样子的&#xff1a; 就是为什么我的只有个主文件&#xff0c;而没有src、webroot、meta-inf、web-inf等子文件呢&#xff1f;&#xff1f; 这是我找了很多网上的资料&am…

实例构造器和类(引用类型)

构造器是允许将类型的实例初始化为良好状态的一种特殊方法。构造器方法在“方法定义元数据表”中始终教.ctor。创建一个引用类型的实例时&#xff0c;首先为实例的数据字段分配内存&#xff0c;然后初始化对象的附加字段&#xff08;类型对象指针呵呵同步块索引&#xff09;&am…

android 文件选择器_Android 开发 打开系统文件、图片、视频等 实现单选多选功能...

在网上搜下&#xff0c;如何实现图片的多选或者文件的多选&#xff0c;令人纳闷的是居然多是moudle、或第三方jar包&#xff0c;当然第三方的工程功能复杂或兼容性比较好&#xff0c;并没有说明Android系统是如何提供多选的。既然这么多图片选择器的工程、或者是文件选择器的工…

C语言错误: HEAP CORRUPTION DETECTED

程序源代码&#xff1a; //写文件两种方式(文本文件和二进制文件)#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<stdlib.h> #include<string.h>//文本写文件 int writeWord(const char *path,const char *pword){int ERRO_MSG 0;if (path N…

您不能不知的ToString()方法

1.1.1 摘要 相信大家对ToString()方法再熟悉不过了&#xff0c;由于该方法是.NET程序中最常用的方法之一&#xff0c;我们除了可以直接调用ToString()方法之外&#xff0c;.NET中的某些方法也隐式调用ToString()方法&#xff08;WPF&#xff0c;Windows Form和Silverlight等&am…

微信转账一次显示两个_微信为啥分红包和转账两大功能?这4个区别你要知道,望相互转告...

众所周知&#xff0c;自从移动支付普及之后&#xff0c;支付宝、微信就已经成为人们手机中必备的APP&#xff0c;其中微信更是具备社交、支付等一系列功能&#xff0c;所以在国内吸引了超十一亿用户的使用&#xff01;当我们节假日、过年时&#xff0c;很多用户都喜欢给亲朋好友…

java 正则提取及替换字符串

2019独角兽企业重金招聘Python工程师标准>>> <% page import"java.util.regex.Pattern" %><% page import"java.util.regex.Matcher" %><% page import"java.util.List" %><% page import"java.util.Array…

使用R语言绘制中国地图

R语言环境 R3.1.1 Windows8.1 需要安装的packages: maptools,gp 绘图所需要的数据 中国地图的GIS数据 &#xff08;可以此下面的网址下载) http://cos.name/wp-content/uploads/2009/07/chinaprovinceborderdata_tar_gz.zip 是一个压缩包&#xff0c;完全解压后包含三个文件&am…

ASP.NET MVC 5 学习教程:控制器传递数据给视图

起飞网 ASP.NET MVC 5 学习教程目录&#xff1a; 添加控制器添加视图修改视图和布局页控制器传递数据给视图添加模型创建连接字符串通过控制器访问模型的数据生成的代码详解使用 SQL Server LocalDBEdit方法和Edit视图详解添加查询Entity Framework 数据迁移之添加字段添加验证…

如何将ListT转换相应的Html(xsl动态转换)(二)

一、前言 紧跟着上一篇随笔&#xff0c;本文主要涉及到如何将xml与xsl动态转换成html&#xff0c;这个才是最关键的地方&#xff0c;所有的内容都是围绕这个主题来进行开展的。根据指定的xsl样式将List<T>转换相应的Html&#xff0c;相关的随笔如下&#xff1a; &#xf…

win10大文件无法移动到U盘

想着把自己的一些文件整理整理&#xff0c;发现稍微大点的文件竟然不能copy到U盘&#xff0c;百度了一番&#xff08;不好意思&#xff0c;最近百度犯错查的正狠^_^&#xff09;,发现因为U盘的格式不是NTFS,只要把U盘格式改为NTFS就可以copy大文件了。 方法一&#xff1a;用命令…