matlab division help needed
古いコメントを表示
I need to perform the thinning algorithm and i am stuck in the division part
t = t - exp (u \sin (x));
i programmed this in matlab and i got an error the mldivision because the two sides are not of the same size ! i am aware both should be equal of the same size but in the algorithm i need to do this kind of division and i dont know how to get my way around it in matlab..
this is my code so far
i = 0; t = 0; u = rand (0,1); x = -pi:.1:pi; t = t - exp (u \sin (x));
while t < T u2 = rand (0,1); if u2 <= (sin(x) \ max(sin(x))) u2; end i = i+1;
end
採用された回答
その他の回答 (2 件)
Sisi Ma
2011 年 3 月 14 日
1 投票
maybe you are looking for the "dot division" (in matlab a.\b). it performs element by element division of two maxtrix.
Walter Roberson
2011 年 4 月 10 日
0 投票
I'm still uncertain that the \ operator was wanted rather than the / operator ??
カテゴリ
ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!