How to implement modulo to the code
古いコメントを表示
for i = 1:N
if (TFx(i) == 0) && (TFy(i) == 0)
if (sOnAngleH0(i)>=xBotEdge && sOnAngleH0(i)<=xTopEdge...
&& AngleHa(i)>=yBotEdge && AngleHa(i)<=yTopEdge)
xi = ceil((sOnAngleH0(i)-xBotEdge)/[(xTopEdge - xBotEdge)/row]);
yj = ceil((AngleHa(i)-yBotEdge)/[(yTopEdge - yBotEdge)/col]);
%%Would the mod go here and if yes how to set up mod()
bins0to120(xi, yj) = bins0to120(xi, yj) + 1;
end
end
end
The code does the following:
xBotEdge = 0
xTopEdge = 360
yBotEdge = 0
yTopEdge = 360
and row and col are 10.
with Matlab I am having a hard time to implement modulos
To three bins that is:
bin0to120
bin120to240
bin240to360
the data will be in their respectfull bins?
Thank you for any help
4 件のコメント
Yash Totla
2019 年 7 月 5 日
Here's the link to the documentation for the mod function in MATLAB. Also, can you elaborate more on why and where you are using the modulo operation?
Walter Roberson
2019 年 7 月 5 日
Your bins are length 121, and they overlap. Which bin is the value 120 exactly to go into?
SugerCodeCude
2019 年 7 月 5 日
編集済み: SugerCodeCude
2019 年 7 月 5 日
SugerCodeCude
2019 年 7 月 5 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Data Distribution Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!