how to write the following equation in matlab ?
1 次查看(过去 30 天)
显示 更早的评论
equation is in attached file, and i am trying like:
%%stair phase
clc;
clear all;
r=1000;
c=1000;
p=32;
N=8;
for i= 1:r
for j=1:c
SP(i,j)=(-pi+(i/p)*2*pi/m).*(i/(m*p)=even + (-pi+((i/p)+1)*2*pi/m).*(i/(m*p)=odd;
end
end
figure(1)
plot(SP);
please help,, where is wrong?
0 个评论
采纳的回答
KSSV
2017-8-29
r=1000;
c=1000;
p=32;
m=8;
SP = zeros(r,c) ;
for i= 1:r
for j=1:c
if mod(i/(m*p),2) %odd
SP(i,j) = (-pi+((i/p)+1)*2*pi/m).*(i/(m*p)) ; %%=odd;
else % even
SP(i,j)=(-pi+(i/p)*2*pi/m).*(i/(m*p)) ;
end
end
end
figure(1)
surf(SP) ;
shading interp
3 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!