how to write the expression ((pi*epsilon)/ln((D-r)/r)) in matlab?
2 次查看(过去 30 天)
显示 更早的评论
c = (pi*epsilon)/log((D-r)/r);
This code doesn't work
2 个评论
Walter Roberson
2020-5-18
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 /
回答(1 个)
David Hill
2020-5-18
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!