参考使用,欢迎下载
2022-01-03 09:05:25 27.13MB Java
function varargout = ganshe(varargin) % GANSHE M-file for ganshe.fig % GANSHE, by itself, creates a new GANSHE or raises the existing % singleton*. % % H = GANSHE returns the handle to a new GANSHE or the handle to % the existing singleton*. % % GANSHE('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in GANSHE.M with the given input arguments. % % GANSHE('Property','Value',...) creates a new GANSHE or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before ganshe_OpeningFcn gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to ganshe_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 ganshe % Last Modified by GUIDE v2.5 21-Jun-2014 11:31:04 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @ganshe_OpeningFcn, ... 'gui_OutputFcn', @ganshe_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 ganshe is made visible. function ganshe_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 d
clear;clc size=512; block=8; blockno=size/block; LENGTH=size*size/64; Alpha1=0.02; Alpha2=0.02; T1=100; I=zeros(size,size); D=zeros(size,size); BW=zeros(size,size); block_dct1=zeros(block,block); i=imread('watermark64by64.png'); mark=reshape(i,1,LENGTH); figure;imshow(i);title('水印'); %subplot(3,2,1);plot(mark);title('水印'); %显示原图 figure;I=imread('lena512512.jpg'); I0=I; imshow(I);title('原始图像'); % BW=edge(I,'canny');figure;;imshow(BW); % title('edge of origine image'); %嵌入水印 k=1; for m=1:blockno for n=1:blockno x=(m-1)*block+1; y=(n-1)*block+1; block_dct1=I(x:x+block-1,y:y+block-1); block_dct1=dct2(block_dct1); BW_8_8=BW(x:x+block-1,y:y+block-1); if m<=1|nT1 Alpha=Alpha2; else Alpha=Alpha1; end block_dct1(1,1)=block_dct1(1,1)*(1+Alpha*mark(k)); block_dct1=idct2(block_dct1); D(x:x+block-1,y:y+block-1)=block_dct1; k=k+1; end end figure;imshow(D,[]);title('嵌入水印后的图像'); %提取水印 k=1; mark1=[];
2022-01-02 09:03:34 45KB MATLAB DCT 添加水印 水印提取
function varargout = net1(varargin) % NET1 M-file for net1.fig % NET1, by itself, creates a new NET1 or raises the existing % singleton*. % % H = NET1 returns the handle to a new NET1 or the handle to % the existing singleton*. % % NET1('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in NET1.M with the given input arguments. % % NET1('Property','Value',...) creates a new NET1 or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before net1_OpeningFunction gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to net1_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 % Last Modified by GUIDE v2.5 02-Aug-2009 23:24:02 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @net1_OpeningFcn, ... 'gui_OutputFcn', @net1_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 net1 is made visible. function net1_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 net1 (see VARARGIN) % Choose de
2022-01-02 09:03:33 9KB MATLAB GUI 鼠标画图 动态画图
clear all close all clc % straight line 1 of the athletic track x1=-10:0.2:10; y1=0*x1+5; % semi-circle 1 of the athletic track theta=pi/2:-0.04:-pi/2; x2=5*cos(theta)+10; y2=5*sin(theta); % straight line 2 of the athletic track x3=10:-0.2:-10; y3=0*x3-5; % semi-circle 2 of the athletic track theta=3*pi/2:-0.04:pi/2; x4=5*cos(theta)-10; y4=5*sin(theta); % Include straight lines and semi-circles to get an entire athletic track x=[x1 x2 x3 x4]; y=[y1 y2 y3 y4]; % Two cycles of the athletic track x=[x x]; y=[y y]; % plot the athletic track plot(x,y) axis([-16,16,-6,6]) axis equal hold on for i=1:length(x) k1=fix(1.1*i); % define velocity of the 1st player (uniform velocity) if k1>length(x) k1=length(x); end h1=plot(x(k1),y(k1),'Color',[1 0 0],'Marker','o','LineWidth',5); % show location of the 1st player k2=fix(1+5*i^(0.76)); % define velocity of the 2nd player (faster at the beginning, then slower) if k2>length(x) k2=length(x); end h2=plot(x(k2),y(k2),'Color',[k2/length(x) 0 k2/length(x)],'Marker','s','LineWidth',5); % show location of the 2nd player
2022-01-02 09:03:33 3KB MATLAB 动画制作 龟兔赛跑 追逐游戏
clear syms x; num=3*x^2+6*x-1; denom=x^2+x-3; f=num/denom; ezplot(f) hold on inf_ans=limit(f,inf); %x趋于正无穷时,函数的极限 roots=solve(denom); %返回分母的解,求出垂直渐近线 %水平渐近线 plot([-8,8],[double(inf_ans),double(inf_ans)],'g') %垂直渐近线 plot([double(roots(1)),double(roots(1))],[-10,10],'r') plot([double(roots(2)),double(roots(2))],[-10,10],'r') title('函数的渐近线') %极值点 f1=diff(f); max_point=solve(f1); figure
2022-01-02 09:03:32 872B MATLAB 符号计算 最值点 渐近线
function optics_prism close all figure('position',[78 276 792 402]); xp=[-0.2,0.2,0];yp=[0.2,0.2,0.5];B=pi/14; ZZ=[xp;yp]'*[cos(B),sin(B);-sin(B),cos(B)]; fill(ZZ(:,1),ZZ(:,2),[0.2,0.4,0.6]); axis([-1,1,0,1]);hold on;set(gca,'color','k'); t=0;A=pi/8;set(gcf,'doublebuffer','on'); x=[-1,-1];y=[0,0]; H=plot(x,y,'w','linewidth',6); while t<0.8; pause(0.1); t=t+0.1; x(2)=-1+t*cos(A); y(2)=t*sin(A); set(H,'xdata',x,'ydata',y); end x1=[x(2),x(2)];y1=[y(2),y(2)];H1=plot(x1,y1,'r'); H2=plot(x1,y1,'color',[1,1,0]);x2=x1;y2=y1; H3=plot(x1,y1,'y');x3=x1;y3=y1; H4=plot(x1,y1,'g');x4=x1;y4=y1; H5=plot(x1,y1,'color',[0,1,1]);x5=x1;y5=y1; H6=plot(x1,y1,'b');x6=x1;y6=y1; H7=plot(x1,y1,'color',[1,0,1]);x7=x1;y7=y1; t=0; C=linspace(pi/16,0,7); s=linspace(1,1.2,7); while t<0.165; pause(0.1);
2022-01-02 09:03:32 1KB MATLAB 三稜镜 色散 折射
这个c#串口调试助手是自己原创的,有什么问题可以联系我,vs2008编译通过
2021-12-31 01:23:55 163KB c#串口调试助手 源程序代码
1
MATLAB学习研究,转MATLAB牛顿法求解非线性方程组 源程序代码(1).rar
2021-12-27 21:22:49 1KB matalb
1
MATLAB源程序代码分享:MATLAB图像处理实现螺纹的识别
2021-12-16 23:06:06 197KB matlab
1