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!