how can i write a code

조회 수: 1 (최근 30일)
shmuel manashirov
shmuel manashirov 2020년 7월 5일
댓글: shmuel manashirov 2020년 7월 5일
hi,
how can i write code that do this algorithm:
Repeat for α = 0 to 180
Repeat for u = 0 to 255
Repeat for v = 0 to 255
{
ρ= u cos α + v sin α
g(ρ, α) = g(ρ, α) + g(ρ, α) δ(u cos α + v sin α -ρ) }
it's with for loop
  댓글 수: 2
madhan ravi
madhan ravi 2020년 7월 5일
It's not MATLAB ?
shmuel manashirov
shmuel manashirov 2020년 7월 5일
no, i need to convert this but i dont know how to write g(ρ, α) in MATLAB

댓글을 달려면 로그인하십시오.

답변 (1개)

Sumeet Singh
Sumeet Singh 2020년 7월 5일
You can try this
for alpha=0:180
for u=0:255
for v=0:255
rho = u*cos(alpha) + v*sin(alpha)
% your code
end
end
end
Create required functions outside the loops or as a separate file and call them where required.
  댓글 수: 3
Sumeet Singh
Sumeet Singh 2020년 7월 5일
Check documentation for creating function. Can you elaborate your problem?
shmuel manashirov
shmuel manashirov 2020년 7월 5일
It has to do with image processing, switching over the Fourier transform spectrum log and getting an angle by radon transformation

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by