وبلاگ تخصصی متلب و نقشه برداری

۹ مطلب در آبان ۱۳۹۴ ثبت شده است

برنامه را در mfile کپی کنید

clc
clear
format bank
n=input('enter number point: ');
for k=1:n
x(k)=input('enter value x: ');
y(k)=input('enter value y: ');
end
mohit=0;
for m=1:n
if m==n
d(m)=sqrt((x(m)-x(1))^2+(y(m)-y(1))^2);
else
d(m)=sqrt((x(m)-x(m+1))^2+(y(m)-y(m+1))^2);
end
mohit=mohit+d(m);
end
disp('mohit polygon')
disp(mohit)
grid on
hold on
plot([x(1),x(m)],[y(1),y(m)],'-b')
plot(x,y,'-r' )
plot(x,y,'*m' )
title('mohit ehsan & ali')
A=polymeter(x,y)
gtext([' meter = ' num2str(A)])

جواد زارع زاده
۲۶ آبان ۹۴ ، ۱۲:۲۸ موافقین ۰ مخالفین ۰ ۱ نظر

برنامه را در mfile کپی کنید

clc
clear all
i=imread('moon.tif');
figure
imshow(i)
j=edge(i,'sobel');
t=edge(i,'canny');
m=edge(i,'log');
figure
imshow(j),title('sobel')
figure
imshow(t),title('canny')
figure
imshow(m),title('log')
subplot(2,2,1),imshow(i),title('asli'),subplot(2,2,2),imshow(j),title('sobel'),subplot(2,2,3),imshow(t),title('canny'),subplot(2,2,4),imshow(m),title('log')

جواد زارع زاده
۲۶ آبان ۹۴ ، ۱۲:۲۳ موافقین ۰ مخالفین ۰ ۰ نظر

برنامه را در mfile کپی کنید

%daroonyabi mahalli-Grid Based-nazdiktarin hamsayegi%
%zp=?%
clc
clear all
format long g
q=input('xyz 4 nogte abcd[xa ya za;xb yb zb;xc yc zc;xd yd zd=');
p=[116 108];
for i=1:4;
a(i)=sqrt((p(1,1)-q(i,1))^2+(p(1,2)-q(i,2))^2) ;
end;
[Q,T] = min(a);
zp=q(T,3)

جواد زارع زاده
۲۶ آبان ۹۴ ، ۱۲:۲۰ موافقین ۰ مخالفین ۰ ۰ نظر

برنامه را در mfile کپی کنید

%daroonyabi mahalli-Grid Based-Bilinear%
%zp=?%
clc
clear all
format long g
a=input('x,y,z a [x y z]=');
b=input('x,y,z b [x y z]=');
c=input('x,y,z c [x y z]=');
d=input('x,y,z d [x y z]=');
p=input('x,y p [x y]=');
dx=input('dx=');dy=input('dy=');
xbp=(p(1,1)-a(1,1))/dx;
ybp=(p(1,2)-a(1,2))/dy;
zp=a(1,3)+(d(1,3)-a(1,3))*xbp+(b(1,3)-a(1,3))*ybp+(a(1,3)-b(1,3)+c(1,3)-d(1,3))*xbp*ybp

جواد زارع زاده
۲۶ آبان ۹۴ ، ۱۲:۰۵ موافقین ۰ مخالفین ۰ ۰ نظر

برنامه را در mfile کپی کنید

%daroonyabi mahalli-Grid Based-idw%
%zp=?%
clc
clear all
format long g
a=input('xyz 4 nogte abcd[xa ya za;xb yb zb;xc yc zc;xd yd zd=');
p=input('xy p [x y]=');
for i=1:4;
d(i)=sqrt((p(1,1)-a(i,1))^2+(p(1,2)-a(i,2))^2);
end;
w1=(1/d(1).^2)/sum(1./(d.^2));
w2=(1/d(2).^2)/sum(1./(d.^2));
w3=(1/d(3).^2)/sum(1./(d.^2));
w4=(1/d(4).^2)/sum(1./(d.^2));
zp=(a(1,3)*w1)+(a(2,3)*w2)+(a(3,3)*w3)+(a(4,3)*w4)

جواد زارع زاده
۲۶ آبان ۹۴ ، ۱۲:۰۰ موافقین ۰ مخالفین ۰ ۰ نظر

برنامه را در mfile کپی کنید

%daroonyabi mahalli-Tin Based-khatti(linear)-matris%
%zP=?%
clc
clear all
format long g
a=input('x,y,z a ra be soorat [x y z] vared konid=');
b=input('x,y,z b ra be soorat [x y z] vared konid=');
c=input('x,y,z c ra be soorat [x y z] vared konid=');
P=input('x,y P ra be soorat [x y] vared konid=');
ma=[1 a(1,1) a(1,2);1 b(1,1) b(1,2);1 c(1,1) c(1,2)];
l=[a(1,3);b(1,3);c(1,3)];
x=(ma'*ma)^-1*ma'*l;
zp=x(1,1)+(x(2,1)*P(1,1))+(x(3,1)*P(1,2))

جواد زارع زاده
۲۶ آبان ۹۴ ، ۱۱:۵۵ موافقین ۰ مخالفین ۰ ۰ نظر

برنامه را در mfile کپی کنید

%daroonyabi mahalli-Grid Based-linear%
%zp=?%
clc
clear all
format long g
a=input('x,y,z a [x y z]=');
b=input('x,y,z b [x y z]=');
c=input('x,y,z c [x y z]=');
d=input('x,y,z d [x y z]=');
p=input('x,y p [x y]=');
dx=input('dx=');dy=input('dy=');
xbp=(p(1,1)-a(1,1))/dx;
ybp=(p(1,2)-a(1,2))/dy;
if xbp>ybp;
delta=0;
elseif delta==1;
end;
zp=(delta*(a(1,3)+(c(1,3)-b(1,3))*xbp+(b(1,3)-a(1,3))*ybp))
+(1-delta)*(a(1,3)+(d(1,3)-a(1,3))*xbp+(c(1,3)-d(1,3))*ybp)

جواد زارع زاده
۲۶ آبان ۹۴ ، ۱۱:۴۵ موافقین ۰ مخالفین ۰ ۰ نظر

برنامه را در mfile کپی کنید

%daroonyabi mahalli-Tin Based-second exact fit%
%zP=?%
clc
clear all
format long g
a=input('x,y,z a ra be soorat [x y z] vared konid=');
b=input('x,y,z b ra be soorat [x y z] vared konid=');
c=input('x,y,z c ra be soorat [x y z] vared konid=');
d=input('x,y,z d ra be soorat [x y z] vared konid=');
e=input('x,y,z e ra be soorat [x y z] vared konid=');
f=input('x,y,z f ra be soorat [x y z] vared konid=');
p=input('x,y P ra be soorat [x y] vared konid=');
ma=[1 a(1,1) a(1,2) a(1,1)^2 a(1,2)^2 a(1,1)*a(1,2)
1 b(1,1) b(1,2) b(1,1)^2 b(1,2)^2 b(1,1)*b(1,2)
1 c(1,1) c(1,2) c(1,1)^2 c(1,2)^2 c(1,1)*c(1,2)
1 d(1,1) d(1,2) d(1,1)^2 d(1,2)^2 d(1,1)*d(1,2)
1 e(1,1) e(1,2) e(1,1)^2 e(1,2)^2 e(1,1)*e(1,2)
1 f(1,1) f(1,2) f(1,1)^2 f(1,2)^2 f(1,1)*f(1,2)];
l=[a(1,3);b(1,3);c(1,3);d(1,3);e(1,3);f(1,3)];
x=(ma'*ma)^-1*ma'*l;
zp=x(1,1)+(x(2,1)*p(1,1))+(x(3,1)*p(1,2))+(x(4,1)*(p(1,1))^2)+(x(5,1)*(p(1,2))^2)+(x(6,1)*p(1,1)*p(1,2))

جواد زارع زاده
۲۶ آبان ۹۴ ، ۱۱:۳۰ موافقین ۰ مخالفین ۰ ۰ نظر

برنامه را در mfile کپی کنید

%ashkarsazi labe ba sobel va canny%
clc
clear all
a=imread('peppers.png');
subplot(2,2,1),imshow(a),title('orginal')
b=rgb2gray(a);
subplot(2,2,2),imshow(b),title('gray')
c=edge(b,'sobel');
subplot(2,2,3),imshow(c),title('sobel')
c=edge(b,'sobel');
subplot(2,2,4),imshow(c),title('canny')

جواد زارع زاده
۲۶ آبان ۹۴ ، ۱۱:۲۰ موافقین ۰ مخالفین ۰ ۰ نظر