作者Marlee (Mar)
看板MATLAB
标题Re: [问题] 高斯二次微分图
时间Fri Mar 29 19:51:12 2013
我已经解决了
我附上档案,大家可以讨论讨论
clear all;
close all;
syms x y s;
G = @(x,y,s) 1/(2*pi*s^2)*exp(-(x^2+y^2)/(2*s^2));
s1=11;
x1=-40:1:40;
y1=-40:1:40;
figure(1);
colormap('Gray')
g1=diff(diff(G(x,y,s1),y),y);
[X1,Y1]=meshgrid(x1,y1);
Z1=subs(g1,{x y},{X1 Y1});
X1=X1+40;
Y1=Y1+40;
surf(X1,Y1,Z1);
axis([0 80 0 80 -inf inf]);
figure(2);
colormap('Gray')
brighten(-0.5);
pcolor(X1,Y1,Z1);
figure(3);
colormap('Gray')
g1=diff(diff(G(x,y,s1),x),x);
[X2,Y2]=meshgrid(x1,y1);
Z2=subs(g1,{x y},{X2 Y2});
X2=X2+40;
Y2=Y2+40;
surf(X2,Y2,Z2);
axis([0 80 0 80 -inf inf]);
figure(4);
colormap('Gray')
brighten(-0.5);
pcolor(X2,Y2,Z2);
figure(5);
colormap('Gray')
g1=diff(diff(G(x,y,s1),x),y);
[X3,Y3]=meshgrid(x1,y1);
Z3=1*(subs(g1,{x y},{X3 Y3}));
X3=X3+40;
Y3=Y3+40;
surf(X3,Y3,Z3);
axis([0 80 0 80 -inf inf]);
figure(6);
colormap('Gray')
brighten(-0.4);
pcolor(X3,Y3,Z3);
figure(7);
colormap('Gray')
brighten(-0.4);
subplot(231);
surf(X1,Y1,Z1);
axis([0 80 0 80 -inf inf]);
subplot(232);
surf(X2,Y2,Z2);
axis([0 80 0 80 -inf inf]);
subplot(233);
surf(X3,Y3,Z3);
axis([0 80 0 80 -inf inf]);
subplot(234);
pcolor(X1,Y1,Z1);
axis off;
subplot(235);
pcolor(X2,Y2,Z2);
axis off;
subplot(236);
pcolor(X3,Y3,-1*Z3);
axis off;
※ 引述《Marlee (Mar)》之铭言:
: 我想画出高斯二次微分的图
: 就像这个http://ppt.cc/EPXm
: 确不知道该如何下手
: 所以上来问问
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.117.95.130