how to write the expression ((pi*epsilon)/ln((D-r)/r)) in matlab?
2 views (last 30 days)
Show older comments
c = (pi*epsilon)/log((D-r)/r);
This code doesn't work
2 Comments
Walter Roberson
on 18 May 2020
The code could fail in some cases involving non-scalars, as the A/B operator is sort of like A*pinv(B) except with some size restrictions. The element-by-element division operator is ./ not /
Answers (1)
David Hill
on 18 May 2020
Are all the variables arrays of equal size? If so, then you need the element-wise operator.
c = (pi*epsilon)./log((D-r)./r);
0 Comments
See Also
Categories
Find more on Shifting and Sorting Matrices 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!