algorithm to code conversion

9 ビュー (過去 30 日間)
ppppp
ppppp 2016 年 11 月 22 日
コメント済み: Walter Roberson 2022 年 4 月 26 日
how to convert the below algorithm to code
algorithm is :
search feasible solution on constraints c(n)
if a feasible solution is found then
c1=0 c2=n
while c1-c22<=0 do
c=(c1+c2)/2
search a feasible solution on constraints c(i)
if a feasible solution is found then
c2=c
else
c1=c
end
end
else
the algorithm cannot obtain any solution is the planning period
end
  1 件のコメント
Walter Roberson
Walter Roberson 2016 年 11 月 22 日
Please do not keep tagging your posts as "important". You get the same priority that every else does, which is "whenever someone is awake and feels like answering the question".

サインインしてコメントする。

回答 (2 件)

DR Somashekar R
DR Somashekar R 2021 年 12 月 10 日
INPUT: S, a 2D grayscale image.
OUTPUT: H 0 , H 1 , and H 2 .
H 0 = PDT(S)
Add a border on top and bottom of S, called S̃ 1
Add a border on the left and right of S, called S̃ 2
Add borders to all 4 sides of S, called S̃ 3
H 1,1 = PDT( S̃ 1 ) and H 1,2 = PDT( S̃ 2 )
H 1 = H 1,1 + H 1,2 − 2H 0
H 2 0 = PDT( S̃ 3 )
H 2 = H 2 0 − H 1 − H 0
return H 0 , H 1 , H 2
  2 件のコメント
DR Somashekar R
DR Somashekar R 2021 年 12 月 10 日
I need matlab code for this algorithm
Can any one help please
Walter Roberson
Walter Roberson 2021 年 12 月 11 日
See padarray() for adding borders.
I have no idea what PDT() is.

サインインしてコメントする。


Manish Sharma
Manish Sharma 2022 年 4 月 26 日
//defining 5 dominant rays
for rayout � 1: 5 do
//defining horizontal angles
for hori � −180: 180° do
//defining vertical angles
for vert � −90: 90° do
//developing rays and increment
rayout[i] � 1
Develop-ray � i+1
hori �� > verti
//finding intersection points
while rayout � intersect do
for j � 1: 2 do
//finding diffracted rays
if difrout � 1 then
raydfr � raydfr + 1
else
end
//finding refracted rays
rays � rayrefr
rayrefr � rayrefr + 1
end
end
end
//applying the proposed model
PLCI(d)[dB] � FSPL(f, d0) + 10n. log(d/d0) + XCI
σSF
end
end
end
  2 件のコメント
Walter Roberson
Walter Roberson 2022 年 4 月 26 日
Unfortunately some of the characters did not come through.
Walter Roberson
Walter Roberson 2022 年 4 月 26 日
difrout is not defined.
The variables involved in your while loop do not appear to be changed in the loop, which would lead to an infinite loop.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by