matlab division help needed
Show older comments
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
Accepted Answer
More Answers (2)
Sisi Ma
on 14 Mar 2011
1 vote
maybe you are looking for the "dot division" (in matlab a.\b). it performs element by element division of two maxtrix.
Walter Roberson
on 10 Apr 2011
0 votes
I'm still uncertain that the \ operator was wanted rather than the / operator ??
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!