matlab程序

matlab程序,第1张

n=100

x=zeros(1,1)

y=x

z=x

for ii=2:n

x(ii)=-y(ii-1)-z(ii-1)

y(ii)=x(ii-1)+a*y(ii-1)

z(ii)=b+[x(ii-1)-c]*z(ii-1)

end

plot3(x,y,z)

给你一个画心的程序,去表白吧:

[x,y,z]=meshgrid(linspace(-5,5,120))

f=(x.^2+(9*y.^2)./4+z.^2-1).^3-((9*y.^2).*(z.^3))./80-(x.^2).*(z.^3)

p=patch(isosurface(x,y,z,f,0))

set(p,'FaceColor','r')

grid on

daspect([1 1 1])

view(-30,24)

图像读取:

global I

% dialog for opening files

[imagefile , pathname]= uigetfile('*.tif')

if imagefile ~= 0

filename=[pathname imagefile]

[X,map]=imread(filename)

I=X

show_Callback(hObject, eventdata, handles)

set(handles.save,'enable','on')

end

图像保存:

global I

[imagefile , pathname, filterindex]= uiputfile({'*.tif','tif''*.*','All Files'},'Image Save As')

if (imagefile ~= 0 &filterindex==1)

filename=[pathname imagefile '.tif']

imwrite(I,filename)

else (imagefile ~= 0)

filename=[pathname imagefile]

imwrite(I,filename)

end

频域增强:

global I

J=imnoise(I,'salt &pepper',0.02)

%gei tuxiang tianjia yanjiao zaosheng

subplot(121),imshow(J)

title('han you zaosheng de yuan tuxiang')

J=double(J)

f=fft2(J)

g=fftshift(f)

[M,N]=size(f)

n=3d0=20

n1=floor(M/2)n2=floor(N/2)

for i=1:M

for j=1:N

d=sqrt((i-n1)^2+(j-n2)^2)

h=1/(1+0.414*(d/d0)^(2*n))

g(i,j)=h*g(i,j)

end

end

g=ifftshift(g)

g=uint8(real(ifft2(g)))

subplot(122),imshow(g)

title('san jie Butterworth lvbo tuxiang')


欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/yw/7909221.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-11
下一篇2023-04-11

发表评论

登录后才能评论

评论列表(0条)

    保存