?? radial_sum.m
字號:
function s=radial_sum(photo_matrix,r,theta)
weishu=size(photo_matrix);
if theta>=360
theta=theta-360;
end;
if theta<0
theta=360+theta;
end;
if theta>180&theta<360
theta=theta-180;r=-r;
end;
N=weishu(1);
if 0<=theta&theta<=45
theta0=theta;flag=1;
elseif 45<=theta&theta<=90
theta0=90-theta;flag=2;
elseif 90<=theta&theta<=135
theta0=theta-90;flag=3;
elseif 135<=theta&theta<=180
theta0=180-theta;flag=4;
else
flag=0;
end;
switch flag
case 0
error('the theta is out of range!');
case 1
cover_matrix=radial_cover(N,r,theta0);
case 2
cover=radial_cover(N,-r,theta0);
cover_matrix=cover';
case 3
cover=radial_cover(N,r,theta0);
cover_matrix=flipud(cover');
case 4
cover=radial_cover(N,r,theta0);
cover_matrix=fliplr(cover);
end;
%covered=photo_matrix.*cover_matrix;
s=sum(photo_matrix(cover_matrix>0));
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -